Click here to monitor SSC SQLServerCentral is supported by Red
Gate Software Ltd. Log in  ::  Register  ::  Not logged in  SQL
DISTINCT on Multiple Columns  By Sarvesh Singh,  The DISTINCT
clause works in combination with SELECT and gives you unique
date from a database table or tables. The syntax for DISTINCT is
show below  SELECT DISTINCT "column_name" FROM "table_name"  If
you want a DISTINCT combination of more than one column then the
syntax is  SELECT DISTINCT column1, column2 FROM "table_name"
Let's look at some examples to understand the usage of the
DISTINCT keyword. First, let's create a table for our
illustration and insert some data.  CREATE TABLE DuplicateTest(
Firstname nvarchar (30) NOT NULL,  Lastname nvarchar(30) NOT
NULL,  PostalCode nvarchar(15) NOT NULL,  City nvarchar(30) NOT
NULL  insert into DuplicateTest   ('Sarvesh', 'Singh', 'B283SP',
'Birmingham'),  ('Steve', 'White', 'EC224HQ', 'London'),
('Mark', 'Smith', 'L324JK', 'Liverpool'),  ('Claire',
'whitehood', 'M236DM', 'Manchester'),