Hi:
I am new to stored procedures so I am hoping someone can point me in the right direction...
My original query looks something like:
(SELECT * FROM db)
[tab]AS tb1
INNER JOIN
(SELECT tb2.a, tb2.b FROM db WHERE tb2.b='xyz')
[tab]AS tb2 ON tb1.a = tb2.a
Using stored procedures, I changed the query to look like:
(SELECT * FROM db)
[tab]AS tb1
INNER JOIN
(SomeProc(xyz))
[tab]AS tb2 ON tb1.a = tb2.a
The stored procedure works fine by itself when I call it but I can't get it to work when I want to join it to some other query. Can I not join on a stored procedure? What am I doing wrong?
Thanks in advance.
- SB
I am new to stored procedures so I am hoping someone can point me in the right direction...
My original query looks something like:
(SELECT * FROM db)
[tab]AS tb1
INNER JOIN
(SELECT tb2.a, tb2.b FROM db WHERE tb2.b='xyz')
[tab]AS tb2 ON tb1.a = tb2.a
Using stored procedures, I changed the query to look like:
(SELECT * FROM db)
[tab]AS tb1
INNER JOIN
(SomeProc(xyz))
[tab]AS tb2 ON tb1.a = tb2.a
The stored procedure works fine by itself when I call it but I can't get it to work when I want to join it to some other query. Can I not join on a stored procedure? What am I doing wrong?
Thanks in advance.
- SB