I want to select that rollnos which have distinct name & address.
create table studento(roll int,name varchar,address varchar(5))
insert into studento values(1,'A','ADD1')
insert into studento values(2,'B','ADD2')
insert into studento values(3,'A','ADD3')
insert into studento values(4,'A','ADDR3')
select name from studento
I have tried the foll. query to retrive the roll that has distinct name,But query is still returning all roll numbers.
select roll from studento where name = (Select distinct(name)
from studento)