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

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -