2006/9/4, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
Hello all,
I need to perform an SQL statement over 5 different tables, with complex
request. To do so, i'm using subqueries.
SELECT ... FROM (SELECT .WHERE) as T1 LEFT JOIN (SELECT
.WHERE) as T2 WHERE .
The problem is that on
Hello all,
I need to perform an SQL statement over 5 different tables, with complex
request. To do so, i'm using subqueries.
SELECT ... FROM (SELECT .WHERE) as T1 LEFT JOIN (SELECT
.WHERE) as T2 WHERE .
The problem is that only JOIN seems working with subqueries (LEFT JOIN
I believe this will work as you want:
select h1.*
FROM hist h1
LEFT JOIN hist h2
on h1.tel = h2.tel
and h2.date_h < '20041027'
where h1.date_h = '20041027'
and h2.tel is null;
This query should return all of the rows from the hist table where the tel
value appears for the date yo
Can I execute this query in a single JOIN statement?
select * from hist
where date_h = '20041027'
and tel not in
(select distinct tel from hist where date_h < '20041027')
I know I could do it using a temporary table, but I wonder if there's a way to do it
directly.
Thanks!
Hector
--
MySQL Gene