CRISTEA, Adrian schrieb:
Hello there,
What is the corect syntax for selecting something like:
select
a,
b,
(min(q) where date<100),
(max(q) where date>100)
from a left join b left join c
group by a.p
i need min() max() values each of them with other WHERE clause.
How can I do that?
sub select or JOIN with condition,
g.e.:
SELECT MAX(copy_high.q),
MIN(copy_low.q)
FROM tab_with_date
LEFT JOIN tab_with_date AS copy_high
ON tab_with_date.pk = copy_high.pk
AND copy_high.date > 100
LEFT JOIN tab_with_date AS copy_low
ON tab_with_date.pk = copy_low.pk
AND copy_low.date < 100
--
Sebastian Mendel
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]