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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get DISTINCT OwnerID

Status
Not open for further replies.
Apr 27, 1999
705
US
Hello,

I have a table with multiple entries for devices where the DEVTYPE = 'iPad' or DEVTYPE = 'iPhone' and each record has the OwnerID. An owner can have multiple records.
I'd like to pull just the OwnerID whether they have and iPad or an iPhone. I am using DISTINCT however it's returning all the records for an owner.

Thanks ahead of time.

fengshui1998
 
if you want to pull just the OwnerID, then do not include any other columns after the keyword DISTINCT

SELECT DISTINCT OwnerID FROM daTable

r937.com | rudy.ca
Buy my new book Simply SQL from Amazon
 
I understand that, but I want to exclude other devtypes like devtype=blackberry or devtype=windowsphone.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top