I am running below select statement and 100% certain that the 2nd line is causing the issue since the subquery runs fine.
Is Where (first,second) IN a valid statement?
The reason I am doing this query is that I will then replace the first select with a delete, so I just want to make sure I am getting the set I want.
select * from edit_proj_isbn e
where (e.record_id, e.proj_isbn)
IN
(
select t_r.record_id, t_r.proj_isbn from editorial e,
(
select ed.record_id as record_id, substring(d.file_name, 1, 13) as epubisbn, epi.proj_isbn as proj_isbn, ed.asset_subtype as asset_subtype
from editorial ed join doc_renditions d on ed.record_id = d.record_id join edit_proj_isbn epi on ed.record_id = epi.record_id
where (ed.asset_subtype like 'epub' or ed.asset_subtype like 'updf' )
and substring(d.file_name, 1, 13) not like epi.proj_isbn
) AS t_r
where t_r.record_id=e.record_id
)
I get below error, with the 2nd line highlighted:
Msg 4145, Level 15, State 1, Line 2
An expression of non-boolean type specified in a context where a condition is expected, near ‘,’.
Thanks,
Bruce
No it is not a valid statement. You need a separate
WHEREclause for each of those.