0

I use PostgreSQL 15 and have two tables:

  • table 1 has only one column id1 (pkey) and has 6 rows (values 1-6)
  • table 2 has only one column id2 (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.

Denis
  • 1
  • 1

0 Answers0