Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
waterduck
Aged Yak Warrior
982 Posts |
Posted - 2009-05-20 : 03:53:58
|
| sorry to bother again...need help for the following query...>"<select st_codefrom (select t.st_code, (m.max_level<=(balance=sum(t.quantity)-sum(t.qtt_out)))as overmax from ord_trx t, st_mast m group by st_code)c |
|
|
waterduck
Aged Yak Warrior
982 Posts |
Posted - 2009-05-20 : 04:20:17
|
| maybe i was not clearselect st_code, balance=sum(t.quantity)-sum(t.qtt_out)from ord_trx tgroup by st_codeselect st_code, max_levelfrom st_masti wan to show out the result of (st_code, max_level in st_mast) which is lower than (st_code, balance in ord_trx) |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-05-20 : 05:01:11
|
[code]select st_code, max_levelfrom st_mast as mastjoin (select st_code, balance=sum(t.quantity)-sum(t.qtt_out) from ord_trx t group by st_code) ord on ord.st_code = mast.st_codewhere mast.max_level <= ord.balance[/code] No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
waterduck
Aged Yak Warrior
982 Posts |
Posted - 2009-05-20 : 21:20:20
|
| thx alot webby |
 |
|
|
|
|
|