select ProductID from (select ProductID from Product where PdTypeID in (select PdTypeID from ProductType where PdTypeParentID in (select PdTypeID from ProductType where PdTypeParentID=1)) as t
select ProductID from (select ProductID from Product where PdTypeID in (select PdTypeID from ProductType where PdTypeParentID in (select PdTypeID from ProductType where PdTypeParentID=1))) as t
少了一个反)号
认真点,少个)。
为何我这么坑爹
就算是写SQL也要养好良好的排版习惯。对排错很有帮助,比如:
SELECT * FROM TABLE
WHERE ..
ORDER BY ...
))) as t
select ProductID from (select ProductID from Product where PdTypeID in (select PdTypeID from ProductType where PdTypeParentID in (select PdTypeID from ProductType where PdTypeParentID=1) ) )