Groups | Blog | Home
all groups > inetserver asp db > march 2004 >

inetserver asp db : problems with distinct/unique select statement



jweiss NO[at]SPAM lanelabs.com
3/31/2004 12:47:20 PM
Here's my quandry...

I have a table called addrTable with the following fields:
storename, storeAddr, address2,City,State,phone, prods

I want to return a recordset based upon the search criteria of prods.

I want to filter out duplicate storeAddr data (this list was generated
from invoices so there will be many duplicate records)

Below is a bit of my table

I am struggling with building the SELECT statement (don't know if I
shoudl be using 'DISTINCT' or a select statement within a select
statement.

Thanks all!



storename storeAddr Address2 City State Phone prods

A & S Natural Health
5710-H High Point Road
Greensboro
NC
336-547-0608
prodY

A & S Natural Health
5710-H High Point Road
Greensboro
NC
336-547-0608
prodY

A 2 Z Vitamins
577 N Azusa Avenue
Covina
CA
626-339-9202
prodY

A 2 Z Vitamins
577 N Azusa Avenue
Covina
CA
626-339-9202
Aaron Bertrand [MVP]
3/31/2004 3:55:22 PM
[quoted text, click to view]

What pieces of information are you trying to select out? If you want the
database to select between one of the above two rows, which do you want,
prodY or prodX? Why?

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/

AddThis Social Bookmark Button