Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email email@example.com
From: Halász Sándor (hsvtbbs.net)
Date: Tue Apr 03 2012 - 20:20:00 CDT
;>>> 2012/04/03 18:18 +0100, Tompkins Neil >>>>
Before sending the table definition, and queries etc, can anyone advise why
my query with four INNER JOIN might be give me back duplicate results e.g
Basically the query the statement AND
(hotel_facilities.hotelfacilitytype_id = 47 OR
hotel_facilities.hotelfacilitytype_id = 7) and if I add additional IDs
like AND (hotel_facilities.hotelfacilitytype_id = 47 OR
hotel_facilities.hotelfacilitytype_id = 7 OR
hotel_facilities.hotelfacilitytype_id = 8), it would return three records
like below when I'm expecting one record.
However in my SELECT statement if I use SELECT DISTINCT (field_name), I
only get back one record.
It is in JOIN s nature to multiply output, but unless you show your whole query, noöne can comment on it. As for DISTINCT, its purpose is as you saw, to eliminate duplicates. Sometimes it is the best means for it--but you show too little for comment.
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql