有一个日期格式的字段,如果为空就让他显示未填,不为空就把这个日期显示出来select name,sex,
(CASE when birthday= '' THEN '未填' when a.AMArrive != '' THEN birthday end)as birthday
from user这条语句是错的,应该怎样写呢
(CASE when birthday= '' THEN '未填' when a.AMArrive != '' THEN birthday end)as birthday
from user这条语句是错的,应该怎样写呢
解决方案 »
- 求取得表中的所有字段,并进行补位的存储过程
- 在线等,关于高级复制中实体化视图和非实体化视图之间外键关系--导致刷新中断!
- 新手问什么是oracle 的path 能通俗一点么?我以前只接触过sqlserver
- 请教:SQL的问题
- 求sql语句:同时取主表数据及从表中最新的一条数据
- 登陆enterprise manager那个sysman的密码可以找的到吗?
- 写一段代码完成对表的循环读取
- 询问如何Drop一个主键?
- Oracle 7.33的数据备份如何导入8.16中,求救??
- 在delphi中连接oracle
- 求助:asp+orcal,在录入数据的时候提示"违反唯一性约束条件",但是能正常录入的问题。
- 在PL/SQL中,通过RAISE_APPLICATION_ERROR抛出得EXCEPTION是什么类型。?
nvl(birthday,'未填') birthday
from user
nvl(to_char(birthday),'未填') birthday
from user
(CASE when birthday is null THEN '未填' else THEN birthday end)as birthday
from user判断是否为空要用 is null
-----
都适用,开始报错是因为birthday和'未填'类型不一致
select name,sex,
(CASE when birthday is null THEN '未填' else THEN birthday end)as birthday
from user
报缺少表达式的错
(CASE when birthday is null THEN '未填' else birthday end)as birthday
from user
(CASE when birthday is null THEN '未填' else birthday end)as birthday
from user报数据类型不一致的错
(CASE when birthday is null THEN '未填' else to_char(birthday, 'yyyy-mm-dd') end)as birthday
from user