The following query works:
select count(*) from everything where num not in (select num from sometable)
The following query is supposed to be equivalent to the above, but results in an “invalid identifier” error:
with unwanted as (select num from sometable)
select count(*) from everything where num not in unwanted
What is wrong with the second query?
the syntax is like this:
obviously this makes only sense if the
select num from sometablepart is a bit more complex or used several times later…