Hello

I would asume that these two queries would give the same output? Am I wrong?
Seems like the where part don't have any effect on the LEFT JOIN when it
comes to MIN() and MAX().

SELECT count( plads_ordre.id )
as antal, MIN( forestilling.arrangement_id )
as min, MAX( forestilling.arrangement_id )
as max
FROM plads_ordre
INNER JOIN forestilling ON forestilling.id = plads_ordre.forestilling_id
WHERE plads_ordre.ordre_id = '25408'

Output:
antal  min  max
1 18 18


SELECT count( plads_ordre.id )
as antal, MIN( forestilling.arrangement_id )
as min, MAX( forestilling.arrangement_id )
as max
FROM plads_ordre
LEFT JOIN forestilling ON forestilling.id = plads_ordre.forestilling_id
WHERE plads_ordre.ordre_id = '25408'

Output:
antal  min  max
1 7 19

--
/ morten

"There are only 10 types of people in the world: Those who understand
binary, and those who don't"



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to