inro sql question -


we starting subqueries, , have bit of toughie(for me, anyways). have customers table, has attribute of creditlimit. have orders table has ordernum, orderdate,quantity, amount. need increase credit limit of customer has order exceeds credit limit. then, take customer , update credit limit plus 1000. help.

i'm assuming there primary-foreign key relationship between customers , orders table.

update customers set customers.creditlimit = customers.creditlimit + 1000     exists (       select * orders orders.amount > customers.creditlimit        , orders.customernumber = customers.customernumber     ) 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -