RE: [PHP] im puzzled

From: Date: Wed, 29 Aug 2001 15:39:04 +0000
Subject: RE: [PHP] im puzzled
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-65035@lists.php.net to get a copy of this message
You need to specify which item to group the query by. SELECT users.uid FROM users, picks WHERE users.uid <> picks.user_id GROUP BY users.uid; -----Original Message----- From: Jeremy Morano [mailto:jeremy@prepresshelp.com] Sent: Wednesday, August 29, 2001 10:42 AM To: php-general@lists.php.net Subject: [PHP] im puzzled Hi , this is my query SELECT users.uid FROM users, picks WHERE users.uid = picks.user_id; this works correctly. The results are what they are supposed to be: However, when I change the = sign to a <> or !=, The results are completely incorrect. ---------------------------------- picks.user_id contains: 5, 1, 7, 8, 9, 12, 13, 15 users.uid contains: 1, 8, 9, 5, 7, 10, 11, 12, 13, 14, 15 the result for SELECT users.uid FROM users, picks WHERE users.uid = picks.user_id; is: 5, 1, 7, 8, 9, 12, 13, 15 and the result for SELECT users.uid FROM users, picks WHERE users.uid <> picks.user_id; is: 1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 5, 7, 8, 9, 10, 11,12, 13, 14, 15, 1, 5, 8, 9, 10 ,11...etc it goes on for 80 rows with no particular pattern......H.E.L.P.!. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#65035) next »