Closed jadetang closed 9 years ago
Hi,
I actually think this is valid sql. For instance, sqlite agrees with me:
sqlite> select * from user where user.age=26=0;
stephentu|27
stephentu|1
ha, mysql accept this, but oracle don't
i tried this sql, it also pass the test
select user and name from table;
Once again, I think this is valid sql as well:
sqlite> create table t (user varchar(10), name varchar(10));
sqlite> select user and name from t;
sqlite>
try this sql
select user and name from table;
in three database in production, the result is: vertica: wrong oracle: wrong mysql: sql not return column 'name' and 'user',instead return 0 for each row.
select user and name from table where max(user)=1;
is wrong in oracle, because the 'group function is not allowed'. I guess it is same for other databases.
for example, the where clause parser:
could parser a simple sql "select * from user where user=20=20" which actually violates the sql grammar,here is test case: