P
paofu
Unregistered / Unconfirmed
GUEST, unregistred user!
mysql(version<4.0)不支持子查询, 请问怎么改写SQL才能达到效果?
select p.*
from products p
left join products_to_categories p2c on p2c.products_id = p.products_id
left join categories c on c.categories_id = p2c.categories_id
where c.categories_id in
(
select categories_id
from categories c
where c.parent_id = 24
)
select p.*
from products p
left join products_to_categories p2c on p2c.products_id = p.products_id
left join categories c on c.categories_id = p2c.categories_id
where c.categories_id in
(
select categories_id
from categories c
where c.parent_id = 24
)