List:General Discussion« Previous MessageNext Message »
From:Martin Ramsch Date:September 23 1999 1:37am
Subject:Re: MYSQL QUERY HELP
View as plain text  
On Wed, 1999-09-22 11:03:16 -0300, Mathieu Levesque wrote:
> SELECT Users.id  FROM  FROM Users LEFT JOIN UserData ON Users.NoSite =
> UsersData.NoSite WHERE NOT(UsersData.Field1 = 62);
[...]
> My current select return 
> 01
> 01
> 02
> 02
> 02
> 02
> 03
[...]
> I would like it returns ONLY:
> 02
> 03
> 
> Only one occurence of others ID too..

Sorry, I didn't understand exactly what you're doing and why you're
using a LEFT JOIN, but anyway ...

Does
      SELECT DISTINCT ...
help?

This way each result is returned only once.

Regards,
  Martin
-- 
Martin Ramsch <m.ramsch@stripped> <URL: http://home.pages.de/~ramsch/ >
PGP KeyID=0xE8EF4F75 FiPr=52 44 5E F3 B0 B1 38 26  E4 EC 80 58 7B 31 3A D7
Thread
MYSQL QUERY HELPMathieu Levesque22 Sep
  • Re: MYSQL QUERY HELPMartin Ramsch23 Sep
    • Re: MYSQL QUERY HELPBob Kline23 Sep
      • Re: MYSQL QUERY HELPMartin Ramsch23 Sep