Hi KFlasph,
Yes you can use a CTE in the select statement of a cursor defintion. Just create the CTE first and verify that it works correctly and give you the results that you want.
Next add the DECLARE CURSOR statement immediately before the WITH statment:
DECLARE cur_TestCURSOR FOR...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.