All pastes #34469 Raw Edit

Miscellany

public text v1 · immutable
#34469 ·published 2005-12-21 13:37 UTC
rendered paste body
query string;
select gen.status, inv.status from generalledger as gen left join invoices as inv on gen.transid = inv.invoiceid where inv.status = 'Paid' and inv.account = 'dispensesource'

Result
+--------+--------+
| status | status |
+--------+--------+
| Paid   | Paid   |
| Open   | Paid   |
+--------+--------+

update query:
update generalledger as gen left join invoices as inv on gen.transid = inv.invoiceid set gen.status = 'Paid' where inv.status = 'Paid' and inv.account = 'dispensesource'

Result:
Query OK, 0 rows affected (0.02) sec
Rows matched: 1  Changed: 0  Warnings: 0