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','A DD1')
insert into studento values(2,'B','A DD2')
insert into studento values(3,'A','A DD3')
insert into studento values(4,'A','A DDR3')
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)
create table studento(roll int,name varchar,address varchar(5))
insert into studento values(1,'A','A DD1')
insert into studento values(2,'B','A DD2')
insert into studento values(3,'A','A DD3')
insert into studento values(4,'A','A DDR3')
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)
Comment