update table sql based on two criterias -


ok have seen few posts on reason code doesn't update trnid field table information on lasttrnid table b, appreciated. if base inner join on 1 field update works, know can done inner join on 2 fields can assume not doing correctly. table , table b created on fly @ beginning of query , have put both sets 1 table. final table should include person , each person first , last transaction per day why doing inner join on crdid , lasttrndate day portion of field.

update     table_a set     table_a.trnid = table_b.lasttrnid        table_a inner join table_b          on (table_a.crdid = table_b.cardholderid)         , (table_a.trnd = table_b.lasttrndate) 

your query looks ok (beside # on #table_a)

so error on data. first check query bringing results

try select see if fields want update , new value correct.

select table_a.trnid, table_b.lasttrnid        table_a  inner join table_b          on table_a.crdid = table_b.cardholderid        , table_a.trnd  = table_b.lasttrndate 

Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -