我在系统上用oracle测试了,你写的语句不应该有引号
可能是由于 你的 id 或 pass 这两列的某行上有空值
你可以这样写
select id|| pass as title
from news
where id is not null and pass is not null;
这样可以把空值的排除掉
(1)不应该是单引号,估计是你笔误。
select id || pass as title from news
(2)看看是不是有空值
select nvl(id,'空')|| nvl(pass,'空') as title from news
这个|| 不是连接的意思,是 逻辑或 的意思,是运算符。
1 || 0 =1
1 || 1 =1
0 || 0=0