Untitled
unknown
pgsql
a year ago
224 B
10
Indexable
UPDATE agents set quota = ( COALESCE((select sum(qty) from orders where agent_id = agents.id and transaction_type = '1' ),0) - COALESCE((select count(id) from advertises where agent_id = agents.id),0) ) where id is not null;
Editor is loading...
Leave a Comment