Simple query for someone...
I have an 'standard' order_detail table that contains the order number, order_line, item_id, and item_type fields.
I want to be able to view a count of orders and order lines that contain at least 1 order line with item_type=x AND 1 order line with item_type=y.
I would also like to be able to sort the report on the count of order lines.
Forgive my ramblings and hopefully it makes sends for what I'm asking for. Any help in general direction would also be appreciated.
btw, database=sybase
Thanks!
Sneedes
I have an 'standard' order_detail table that contains the order number, order_line, item_id, and item_type fields.
I want to be able to view a count of orders and order lines that contain at least 1 order line with item_type=x AND 1 order line with item_type=y.
I would also like to be able to sort the report on the count of order lines.
code:<HR>Code:i.e. item_id type orders order_lines -------- ------ --------- ---------- itm_32A Z2 3,233 3,452 itm_39C X1 598 598 itm_32A Z2 2,900 2,942 itm_888 X4 2,832 2,901
Forgive my ramblings and hopefully it makes sends for what I'm asking for. Any help in general direction would also be appreciated.
btw, database=sybase
Thanks!
Sneedes