I need to join result sets inside a stored procedure, I tried this query but it is incorrect.
SELECT * FROM (SELECT Field1, Field2 FROM Table1 WHERE Field4='val1') A
INNER JOIN
SELECT * FROM (SELECT Field1, Field3 FROM Table1 WHERE Field4='val2') b
ON A.Field1 = B. Fileld1
How to join resulting tables inside a stored procedure?
try this:
you don’t have to use SELECT * FROM twice..