[thelist] SQL: Eliminating Duplicates with .getRows()

Ken Kogler ken.kogler at curf.edu
Mon Sep 2 23:28:01 CDT 2002


Well, that worked, but I'm facing the same problem. Perhaps some
resultant data would help... This is 3 rows from the recordset (using
the SQL from your last post, Rudy):

sID    | sNumber | sTitle                 | sOshaAnsi | aApp
------ | ------- | ---------------------- | --------- | ----------
010017 | D1024   | DANGER- do not oper... | OSHA      | Electrical
010027 | ZD1050  | DANGER- electrical...  | ANSI Z535 | Electrical
010027 | ZD1050  | DANGER- electrical...  | ANSI Z535 | Laser

Note that the 2nd and 3rd rows are the same sign. Row #2 matches the
search string ("electrical") in both the title and the app (also called
"category"). Row #3 is returned because the search string is in the
title but not the category.

It seems like I should do "...WHERE sNumber != sNumber" but I know
that's not right (since it blows up on me :)

It's a one-to-many relationship between signs and categories, so this
xrefAppsSigns table has multiple rows for each sign; the exact number
depends on how many categories each sign belongs to.

How can I prevent sign number "ZD1050" from being returned as rows 2 AND
3? I'm desprately trying to do this via SQL. The only alternative I can
see is looping through the recordset row by row and comparing the
current sNumber to the previous one, but I know that's not a good
option.

Thanks in advance!

--Ken




More information about the thelist mailing list