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 |
|
just_a_kid83
Starting Member
1 Post |
Posted - 2004-05-23 : 05:15:37
|
| hi.. anyone know who to find the max after i sum up??i have this query but it seems didnt work..when i use max(sum(cc.quantity)) they said it violates the rules??please help me...select cc.isbn from cart_contains cc,book bo,shopping_cart scwhere cc.cartId=sc.cartid and cc.isbn=bo.isbn and (sc.State='checked-out' OR sc.State='fulfilled')group by cc.isbnhaving sum(cc.quantity) > all( select sum(cc.quantity) from cart_contains cc,book bo,shopping_cart sc where sc.cartid=cc.cartid and bo.isbn=cc.isbn group by cc.isbn ) ) God Bless u |
|
|
LarsG
Constraint Violating Yak Guru
284 Posts |
Posted - 2004-05-23 : 09:39:41
|
| [code]select max(s) from (select sum(c) as s from ... ) as dt[/code] |
 |
|
|
|
|
|