I want only distinct values in one cloumn other columns can contain duplicate values,how do I achieve this
create table test
(
Id int,
Name varchar(max),
Department varchar(max),
Country varchar(max)
)
insert into test values (1,'B','IT','India')
insert into test values (2,'B','IT','US')
insert into test values (3,'C','HR','UK')
insert into test values (4,'D','HR','India')
insert into test values (5,'E','IT','US')
insert into test values (6,'F','IT','UK')
select * from test
I just want the non duplicate values in country column.
select id,country from test group by country FAILED
select id,country distinct from test FAILED