sql列别名引发ORA-00923: FROM keyword not found where expected
SQL> create table t_a(a int); Table created SQL> select a as 成功/失败 from t_a;--因别名包含/引发错误 select a as 成功/失败 from t_a ORA-00923: FROM keyword not found where expected SQL> select a as 成功/失败 from t_a;--对别名添加单引号失败 select a as 成功/失败 from t_a ORA-00923: FROM keyword not found where expected SQL> select a as "成功/失败" from t_a;--添加双引号即可 成功/失败 ---------------------------------------
小结:1,最好在列别名不用要汉字,兼容太差
2,不要在列别名中使用特殊字符如:/
SQL> create table t_a(a int); Table created SQL> select a as 成功/失败 from t_a;--因别名包含/引发错误 select a as 成功/失败 from t_a ORA-00923: FROM keyword not found where expected SQL> select a as 成功/失败 from t_a;--对别名添加单引号失败 select a as 成功/失败 from t_a ORA-00923: FROM keyword not found where expected SQL> select a as "成功/失败" from t_a;--添加双引号即可 成功/失败 --------------------------------------- 小结:1,最好在列别名不用要汉字,兼容太差 2,不要在列别名中使用特殊字符如:/下一篇:
MySQL查询近12个月数据,无则补0