How do I joint 2 simple SQL statements?
Posted on 2008-06-11
I have two simple sql statements that I need to join...how would I do that?
P.SEQUENCE is the same as D.SEQUENCE
AND P.BILL is the same as M.IDENT
Here are the statements:
SELECT P.BILL, P.SEQUENCE, P.LOCATION, P.TYPE
FROM dbo.POLICY P
WHERE P.BILL = '24680'
SELECT M.IDENT, D.SEQUENCE, I.IDENT, S.IDENT, D.*
FROM BILL M (NOLOCK),
INVOICE I ,
STATUS S ,
WHERE M.IDENT = '24680'
AND I.IDENT = '13579'
AND I.BILL = M.IDENT
AND S.INVOICE = I.IDENT
AND D.STATUS = S.IDENT