Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unique Values with other data 1

Status
Not open for further replies.

snyperx3

Programmer
May 31, 2005
467
US
Ive looked into the DISTINCT portion of SQL and im not too sure how to get this to work the way i want it to. I have a table that has item number and item description for each store. some stores have the same items as another store, so what im trying to do is get the query to pull the unique item numbers and get their description as well. Thanks for the help.

Pete
 
Don't know your fields or table structures but ...
Code:
Select DISTINCT A.ItemNo, A.Description

From tblItems As A

WHERE A.Store = 1 AND

      A.ItemNo NOT IN
      (Select B.ItemNo From tblItems B Where B.Store = 2)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top