Inconsistent Error messages between SELECT and SELECT COUNT statements
(1) By Yu Liang (LY1598773890) on 2021-05-07 21:41:17 [source]
CREATE TABLE v0 ( v1 INT ); /* STMT 1 */ SELECT * FROM v0 JOIN v0 ON v1 = 0 WHERE 0; /* Error: ambiguous column name: v1 */ /* STMT 2 */ SELECT COUNT ( * ) FROM v0 JOIN v0 ON v1 = 0 WHERE 0; /* Outputs '0' */
Apparently both STMT 1 result and STMT 2 result are correct and easy to understand. I just wonder whether we want to make it consistent, like both return error messages, or STMT 1 returns empty set and STMT 2 returns 0.
We appreciate any feedback available. Thank you.