SELECT Email
FROM mailing_list
ORDER BY JoinDate
SQL Error: There is no field named JoinDate in the resulting FROM table.
Ok? What engine is this using? That's valid SQL in my universe.
In PostgreSQL 12:
mulmen@shell> psql
psql (12.1)
Type "help" for help.
mulmen=# CREATE TABLE foo ( bar INT, baz INT );
CREATE TABLE
mulmen=# INSERT INTO foo VALUES (1, 10), (2, 20);
INSERT 0 2
mulmen=# SELECT bar FROM foo ORDER BY baz;
bar
-----
1
2
(2 rows)
mulmen=#
Thank you for the feedback.
The SQL parsing is home made and I assumed fields in the order by clause is also a part of the SELECT.
I collect a window of failed queries in memory (without knowing who sent what) to find cases like this and fix them.
Comments (86) 37 threads
Show all comments
Showing thread 12 of 37
In PostgreSQL 12: