retrieval of unique data

Please support our MS SQL advertiser: Intel Parallel Studio Home
Reply

Join Date: Jul 2005
Posts: 7
Reputation: wani_raj is an unknown quantity at this point 
Solved Threads: 0
wani_raj wani_raj is offline Offline
Newbie Poster

retrieval of unique data

 
0
  #1
Apr 10th, 2008
I want make a query to retrieve only those records from table which are unique on the basis of some coloumns
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 324
Reputation: sonia sardana has a little shameless behaviour in the past 
Solved Threads: 7
sonia sardana sonia sardana is offline Offline
Posting Whiz

Re: retrieval of unique data

 
0
  #2
Apr 10th, 2008
  1. CREATE TABLE student9(roll INT)
  2. INSERT INTO student9 VALUES(1)
  3. INSERT INTO student9 VALUES(1)
  4. INSERT INTO student9 VALUES(2)
  5. INSERT INTO student9 VALUES(3)
  6. SELECT DISTINCT * FROM student9
Last edited by peter_budo; Apr 10th, 2008 at 5:25 pm. Reason: Keep It Organized - please use [code] tags
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 7
Reputation: wani_raj is an unknown quantity at this point 
Solved Threads: 0
wani_raj wani_raj is offline Offline
Newbie Poster

Re: retrieval of unique data

 
0
  #3
Apr 11th, 2008
Originally Posted by sonia sardana View Post
  1. CREATE TABLE student9(roll INT)
  2. INSERT INTO student9 VALUES(1)
  3. INSERT INTO student9 VALUES(1)
  4. INSERT INTO student9 VALUES(2)
  5. INSERT INTO student9 VALUES(3)
  6. 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
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 206
Reputation: plazmo is an unknown quantity at this point 
Solved Threads: 16
plazmo's Avatar
plazmo plazmo is offline Offline
Posting Whiz in Training

Re: retrieval of unique data

 
0
  #4
Apr 15th, 2008
Originally Posted by wani_raj View Post
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...
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the MS SQL Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC