I need a little help with this distinct query.
Table example:
------
ID CompanyName Region
1 South Inc. Northwest
2 USA Inc. Southwest
3 North Inc. Southeast
4 USA Inc. Southwest
------
I want to distinctly select on the CompanyName while selecting all of the columns above. I found that using Distinct will look at all columns selected in the sql statement, but I need to only select distinctly on companyname and grab other columns as well. In this situation, USA, Inc. will only show once in the results.
Life would probably be easier if the DB was normalized, but this is not the case or an option at the time.
I have messed around with sub-queries and it seems like this may be the way to go, but I cant seem to get it done.
Is this possible?
Thanks
Table example:
------
ID CompanyName Region
1 South Inc. Northwest
2 USA Inc. Southwest
3 North Inc. Southeast
4 USA Inc. Southwest
------
I want to distinctly select on the CompanyName while selecting all of the columns above. I found that using Distinct will look at all columns selected in the sql statement, but I need to only select distinctly on companyname and grab other columns as well. In this situation, USA, Inc. will only show once in the results.
Life would probably be easier if the DB was normalized, but this is not the case or an option at the time.
I have messed around with sub-queries and it seems like this may be the way to go, but I cant seem to get it done.
Is this possible?
Thanks