Question : SQL qUERY

I want to do the folllowing

 Select CollectionID from Collections where Title= 'something i pass in' and CompanyID='something i pass in'

I want to take that collectionID and search the collection table like this

 Select collectionid From Collections where ParentID =  'the collection id is what i got back in the previous query

Can I do this with just one query?

Answer : SQL qUERY

this should do:
1:
2:
3:
4:
5:
Select t2.CollectionID
from Collections t1
INNER JOIN Collections t2 on t1.CollectionID = t2.ParentID
where t1.Title= @title 
and t1.CompanyID= @companyid
Random Solutions  
 
programming4us programming4us