I use PostgreSQL 15 and have two tables:
table 1has only one columnid1(pkey) and has 6 rows (values 1-6)table 2has only one columnid2(pkey) and has 6 rows with some another values
Then I try execute this SQL query (this is no real query, just for example):
select id1 from table1 where id1 in (select id1 from table2)
and get result: 6 rows from table 1.
I can not understand, why this query can even work if table 2 has no column with name id1
Query select id1 from table2 returns an error as expected.
P.S.: If I try to execute this strange query from my C# application via npgsql v7 - I get an error.