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 |
|
Tye
Starting Member
1 Post |
Posted - 2009-06-04 : 19:42:53
|
| I'm not sure even what to title this.At a very basic level, here is my dataLibrary Item------- ----Library1 ItemALibrary2 ItemALibrary3 ItemALibrary2 ItemBLibrary3 ItemBLibrary3 exists for every time in the table and I only want to select Library3/Item pair if Library1 and Library2 don't exist for the item.If Library2 exists and Library1 does not, I want to select the Library2/Item pair and ignore or not select in my results the Library3/Item pairand finally if Library1 exists on the item I want to select only the Library1/Item pair and ignore the Library2 and Library3 pairs.I'm struggling to figure out where to begin. CASE? IF ELSE? Can anybody help peel this back? |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-06-05 : 13:09:51
|
| [code]SELECT MIN(Library),ItemGROUP BY Item[/code] |
 |
|
|
|
|
|