mysql - Database update query -
this query did earlier fetch sum
    select  e.id staffid,             sum(ic.amountreceived) totalamount,inv.invoicetype accounttype             invoice_collection ic,employee e ,invoice inv             ic.collectedby=e.id , ic.operatorcode=#operatorcode#             , inv.invoiceno=ic.invoiceno , e.id=#staffid# , ic.journalfetchstatus=1             , txndate > #createdon#             group inv.invoicetype; i trying solve update issue same conditions
update invoice_collection set journalfetchstatus=0         ic.collectedby=e.id , ic.operatorcode=#operatorcode#         , inv.invoiceno=ic.invoiceno , e.id=#staffid#         , txndate > #createdon#         group inv.invoicetype; 
try this:
update invoice_collection ic  inner join employee e on ic.collectedby=e.id  inner join invoice inv on inv.invoiceno=ic.invoiceno  set journalfetchstatus=0  ic.operatorcode=#operatorcode# , e.id=#staffid# , txndate > #createdon#; 
Comments
Post a Comment