Difficult MySQL question about Rewriting Subqueries as Joins
In my portal I use MySQL version 4.1.7 where i can use subquerys but now i need to move my
portal to server where is MySQL version 3.23.58.
This SQL statement should convert to form where is NO subquerys and do it only ONE statement:
select * from ajanvaraus where toimenpidetunnus in(select toimenpidetunnus from toimenpide where kategorianimi = (select distinct kategorianimi from toimenpide where toimenpidetunnus = $tp))";
I managed to convert inner subquery to form:
select taulu2.toimenpidetunnus from toimenpide as taulu1, toimenpide as taulu2 where taulu1.toimenpidetunnus = $tp and taulu1.kategorianimi = taulu2.kategorianimi
now i need to compine my last two querys togehter... but how???
Bookmarks