The easiest way to do this would be with a join:select sid.* --<--- select * is bad practice, list the columns You wantfrom supplierinvoice si join supplierinvociedetails sid on si.supplierinvoice = sid.supplierinvoice and si.companypo = sid.companypo
The IN operator can't take multiple arguments like You tried.You would have to use the EXISTS clause:select * from supplierinvociedetails sidwhere exists( select * from supplierinvoice si where si.supplierinvoice = sid.supplierinvoice and si.companypo = sid.companypo)
rockmoose