![]() |
|
|
|||||||
![]() |
|
|
Thread Tools | Rate Thread |
|
|
PM User | #1 |
|
New to the CF scene Join Date: Jan 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
“Rewriting Subqueries as Joins for Earlier MySQL Version
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 |
| Thread Tools | |
| Rate This Thread | |
|
|