You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FROM DUAL is "Table does not exist: DUAL". In MySQL and Oracle DUAL is a table of one row for a SELECT that needs no table; SELECT 1 + 1 without FROM works in AlaSQL already.
Seen in the MySQL server tests run (alasql-mysqltest): 313 statements in 61 files, for example SELECT MBROverlaps(@horiz1, @vert1) FROM DUAL. Reproduced with alasql 4.21.0:
alasql('SELECT 1 + 1 AS x');// [{x: 2}]alasql('SELECT 1 + 1 AS x FROM DUAL');// Table does not exist: DUALalasql('CREATE TABLE dual (x INT)');alasql('INSERT INTO dual VALUES (5)');alasql('SELECT x FROM dual');// [{x: 5}]: a table named dual works
Expected: FROM DUAL is the same as no FROM.
Breaking?
No, if DUAL means the one-row table only when the database has no table named dual, so the last query keeps its result.
This holds as long as the new word DUAL stays usable as a name, so that SELECT dual FROM t on a column called dual keeps working. #2627 is the list of keywords made usable as names this way.
I'd like to take this one. I'm planning to treat a lone FROM DUAL as no FROM at compile time, but only when the database has no table called dual. A real dual table and a column named dual would keep working the way they do now.
Activity
thelastbackspace commentedon Nov 5, 2026
I'd like to take this one. I'm planning to treat a lone
FROM DUALas noFROMat compile time, but only when the database has no table called dual. A realdualtable and a column nameddualwould keep working the way they do now.Support FROM DUAL to close AlaSQL#2860 (AlaSQL#2958)