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 |
|
OSXFreak
Starting Member
1 Post |
Posted - 2010-12-02 : 09:29:22
|
| I am not sure where to begin, but I have the need to select unique records in a list.Basically here's what I have.Product# Whse#abc 1abc 2abc 3abc 4def 2a1a2 2a1a2 1a5a5 1www 1www 2www 3So based on the above, I need to select the part numbers in whse 1 and 2, that do not exsist in any other whse. So basically I would need to ONLY select def, a1a2(whse 2),a1a2(whse 1) and a5a5. Ignoring the items if they already exsist in whsr 3, 4 and so on.Thanks for any assitance you can offer in this.Chip |
|
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2010-12-02 : 09:34:27
|
| select product#, max(whse#)from tblgroup by product#having max(whse#) <= 2==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|
|