User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MS SQL section within the Web Development category of DaniWeb, a massive community of 375,199 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,050 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS SQL advertiser:
Views: 538 | Replies: 3
Reply
Join Date: Jul 2005
Posts: 7
Reputation: wani_raj is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
wani_raj wani_raj is offline Offline
Newbie Poster

retrieval of unique data

  #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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Mar 2008
Posts: 115
Reputation: sonia sardana is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
sonia sardana sonia sardana is offline Offline
Junior Poster

Re: retrieval of unique data

  #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 4:25 pm. Reason: Keep It Organized - please use [code] tags
Reply With Quote  
Join Date: Jul 2005
Posts: 7
Reputation: wani_raj is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
wani_raj wani_raj is offline Offline
Newbie Poster

Re: retrieval of unique data

  #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  
Join Date: Aug 2005
Location: Ohio
Posts: 204
Reputation: plazmo is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 16
plazmo's Avatar
plazmo plazmo is offline Offline
Posting Whiz in Training

Re: retrieval of unique data

  #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  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb MS SQL Marketplace
Thread Tools Display Modes

Other Threads in the MS SQL Forum

All times are GMT -4. The time now is 2:28 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC