p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

sql_language thread: SQL DISTINCT


Message #1 by "AG" <AileenG@m...> on Thu, 21 Dec 2000 14:02:53 -0000
SELECT DISTINCT will give you unique occurances of all the items in your select list.  Suppose you
have a table with the following three records:

PatientID     PatientName     ICD9Description

0001          Barney          Goute
0001          Barney          Ulcer
0001          Barney          Purple Skin

SELECT DISTINCT PatientID, PatientName, ICD9Description will return all three rows, because the
value of the third field for each record is different, making the combination of the three fields
distinct.  Conceptually, how would you handle the different values of ICD9Description with just
one record?  If you could show us what you would like the output to look like in this example, we
can help you write the SQL to get there.

Kelly Rowe


---
You are currently subscribed to sql_language as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-sql_language-$subst('Recip.MemberIDChar')@p2p.wrox.com

  Return to Index