How do I Select only ONE of each item in my sql query?
Posted on 2014-08-15
I am selecting Distinct records from a query but in some cases it will pull the same record because something in the query is different. For example I am running a query to pull company names, the city they are in and the state they are in. The company has a unique ID and I want to select Distinct ID's not full records. The query returns the correct information but if the company has two addresses, then it will return the company twice. I want only one address to be shown. Each address has an Address Type, but if I limit it to a type, I do not get all the companies.