SELECT *
FROM Department
WHERE (COC LIKE
(SELECT COC
FROM Department
WHERE DeptID = '12345'))
Though of course this doesn't work. It will only return those identical to the returned value. If I were to just "do it" without a subquery it'd be
SELECT * FROM Department WHERE COC LIKE '1;14;16;232;12345;' and it would return everything from this department downward.
Is there a way to do a partial like on a subquery results?Not sure if I understood you correctly but try this:
Select *
from Department a
join Department b on a.COC = b.DeptID
where a.DeptID = '12345'
No comments:
Post a Comment