orcale的case when的问题 想实现case when的then后面实现赋值操作,类似于case when ..then num1='2',num2='3',num1,num2是两个自定义字段,表中其实没有的,为了在页面显示用的 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 后台sql拼接 或者存储传参数 我就是想知道这个sql怎么写啊 你的意思是下面这样的???select c1, c2, case when c1 = 11 then 2 end num1, case when c2 = 11 then 3 end num2 from c; 能不能:case when ..then '2' end as num1case when ..then '3' end as num2 不是3楼你那是case when最基本的用法,我的意思是then后面给5个数据库字段赋值 “给数据库字段赋值”,就一种方法: insert如果你的case when then 在值的位置,可以,如果在字段的位置,不能。必须借助其它编程语言(Java,c#,c++...)或者PL/SQL。 一个case when 只能给一个字段赋值。。要给多个字段赋值,必须得有多个case when才行。写多个case when 为什么不行?????? 一整个case when then end 只返回一个字段如果你要五个字段,就写5个case when..end 关于字符串缓冲区太小的问题,ORA-06502!在线等啊! oracle怎样添加一个条件实现下述效果 想写一个函数,参数是数据表类型 调用存储过程出错 从表1复制数据到表2 菜鸟问题五: sqlplus数据显示格式问题? 构造一个理想的查询 SQL 转换成oracle 写法 如何改变Keep pool size的最大值 RMAN窗口输出和日志记录 请教关于查询字段内容为逗号分隔的方法
select c1,
c2,
case
when c1 = 11 then
2
end num1,
case
when c2 = 11 then
3
end num2
from c;
case when ..then '3' end as num2
“给数据库字段赋值”,就一种方法: insert如果你的case when then 在值的位置,可以,
如果在字段的位置,不能。必须借助其它编程语言(Java,c#,c++...)或者PL/SQL。
一个case when 只能给一个字段赋值。。要给多个字段赋值,必须得有多个case when才行。写多个case when 为什么不行??????
如果你要五个字段,就写5个case when..end