Say I have a customer address table:
CName | AddressLine ------------------------------- John Smith | 123 Nowheresville Jane Doe | 456 Evergreen Terrace John Smith | 999 Somewhereelse Joe Bloggs | 1 Second Ave
In a table, a single client, such as John Smith, can have multiple addresses. I need a select query for this table to return only the first row found where there are duplicates in "CName". For this table, it should return all rows except the third (or the 1st — either of these two addresses is OK, but only one can be returned). Is there a keyword that I can add to the SELECT query for filtering based on the fact that the server has already seen the column value before?
sql sql-server tsql select
nuit9 Jan 11 2018-11-11T00: 00Z
source share