DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   MS SQL (http://www.daniweb.com/forums/forum127.html)
-   -   retrieval of unique data (http://www.daniweb.com/forums/thread118459.html)

wani_raj Apr 10th, 2008 1:51 pm
retrieval of unique data
 
I want make a query to retrieve only those records from table which are unique on the basis of some coloumns

sonia sardana Apr 10th, 2008 3:35 pm
Re: retrieval of unique data
 
create table student9(roll int)
insert into student9 values(1)
insert into student9 values(1)
insert into student9 values(2)
insert into student9 values(3)
select distinct * from student9

wani_raj Apr 11th, 2008 12:31 pm
Re: retrieval of unique data
 
Quote:

Originally Posted by sonia sardana (Post 581772)
create table student9(roll int)
insert into student9 values(1)
insert into student9 values(1)
insert into student9 values(2)
insert into student9 values(3)
select distinct * from student9



It is retrieval of unique records from table but I want retrieval of those records which are unique on some coloumns eg if table have 5 coloumns I want to retrieve only those records which are unique on 3 coloumns suppose a student table stores details of all college students I want to retrieve those records which are unique on name and address

plazmo Apr 15th, 2008 8:54 am
Re: retrieval of unique data
 
Quote:

Originally Posted by wani_raj (Post 582484)
It is retrieval of unique records from table but I want retrieval of those records which are unique on some coloumns eg if table have 5 coloumns I want to retrieve only those records which are unique on 3 coloumns suppose a student table stores details of all college students I want to retrieve those records which are unique on name and address



just replace the * with the column names...


All times are GMT -4. The time now is 1:36 am.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC