I'm porting a intranet application from MS-SQL-Server to MySQL. Until now I
could rewrite the queries containing subqueries with joins or other methods.
But the example below is driving me mad. How can I rewrite it for MySQL?
SELECT tl.ext,tl.data,tl.numar,tl.co,co.tip,co.data,tl.durata
FROM telefon_log AS tl
LEFT OUTER JOIN co ON (tl.co=co.co AND
co.data=(SELECT MAX(data) FROM co
WHERE co.data<=tl.data AND co.co=tl.co))
WHERE tl.data >'2000-03-14 00:00:00' and tl.data <= '2000-03-16 23:59:59'
and tl.ext in (253,132)
ORDER BY tl.ext,tl.data