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 |
|
jrockfl
Posting Yak Master
223 Posts |
Posted - 2004-10-26 : 21:41:46
|
| Is it possible to to return only the record where the item_no appears 2 or more times?SELECT item_no, request_dtFROM OELINHST_SQLWHERE (Cus_No = '000000005001') AND (Ord_Type = 'O') AND (Qty_Bkord = '0')ORDER BY Item_No DESCExample results...400-102 20040901400-102 20041001 |
|
|
t1g312
Posting Yak Master
148 Posts |
Posted - 2004-10-27 : 00:33:30
|
| SELECT item_no, request_dtFROM OELINHST_SQLWHERE (Cus_No = '000000005001') AND (Ord_Type = 'O') AND (Qty_Bkord = '0') AND item_no IN (SELECT item_no FROM OELINHST_SQL GROUP BY item_no HAVING count(item_no) > 2)ORDER BY Item_No DESCAdi-------------------------/me sux @sql server |
 |
|
|
jrockfl
Posting Yak Master
223 Posts |
Posted - 2004-10-27 : 07:32:58
|
| Perfect. Thank you! |
 |
|
|
|
|
|