with cte as
(
select rowid from batchinfo where datapath like '%thc%'
)
select * from qvalues where rowid in cte
i am getting this error:
Msg 102, Level 15, State 1, Line 6
Incorrect syntax near ‘cte’.
does anyone know what am doing wrong?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
you are treating a CTE as a subquery, where instead it should be used more like a table.
try this