I’m not a SQL Server expert. I am trying to execute a query. The query relies on a function to split a CSV and doing a join on a table. Its a pretty basic query that looks like the following:
SELECT
*
FROM
[Order]
WHERE
dbo.ConvertIDListToTable('1,2,3,4', ',') l INNER JOIN Order o ON l.item=o.ID
When I execute the query, I get the following error:
An expression of non-boolean type specified in a context where a condition is expected, near 'l'.
What am I doing wrong? This has to be something syntactical. I keep staring at it, but everythign looks correct to me. Thank you.
Syntactically, your
INNER JOINs should come before yourWHEREstatement, and in addition, you don’t need theWHEREstatement here.Not knowing the exact code of
ConvertIDListToTableis a hindrance, but assuming it returns a table, I think you need: