Wrox Home  
Search P2P Archive for: Go

  Return to Index  

sql_language thread: SQL code needed


Message #1 by msavoy@h... on Thu, 20 Jun 2002 13:42:23
Something like this will work.

SELECT DISTINCT [ClientName],[ClientAddress]
FROM Table
WHERE [Service] = 'PRODUCT-A'
ORDER BY [ClientName]



-----Original Message-----
From: msavoy@h... [mailto:msavoy@h...]
Sent: Thursday, June 20, 2002 8:42 AM
To: sql language
Subject: [sql_language] SQL code needed


My situation is that I have table that contains both demographic info for 
each client and the services that that client has purchased from our 
company.  I am needing to state within a web page the following:

List all the clients "once" within my recordset and state within my web 
page in a separate column when the client has a service called PRODUCT-A.

Of course if I do a straight select statement:

select distinct *
from table 
order by lastname

I typically get a client listed multiple times with all his services.  
However I only need that client listed once.

Any help for some generic code would be appreciated.

Thank for any help for direction. 

  Return to Index