社区
基础和管理
帖子详情
oracle中条件语句怎么写?
Lkf2006
2007-03-07 05:07:04
在sql server 中条件判断可以这么写:case().....when().......then()
那在oracle中怎么写的?
请教高手!
...全文
907
7
打赏
收藏
oracle中条件语句怎么写?
在sql server 中条件判断可以这么写:case().....when().......then() 那在oracle中怎么写的? 请教高手!
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
7 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
左大神在这
2007-03-08
打赏
举报
回复
PL/SQL语句
pt870219
2007-03-08
打赏
举报
回复
利用Oracle 函数
spiderzzl
2007-03-08
打赏
举报
回复
select case when conditionA then resultA
when conditionB then resultB
...
else resultE
end
from table1;
chendezhu1985
2007-03-07
打赏
举报
回复
这应该PL/SQL语句吧
jiazheng
2007-03-07
打赏
举报
回复
case n
when 1 then ...
when 2 then ...
else ...
end
或
case when n=1 then ...
when n=2 then ...
else ...
end
chensheng913
2007-03-07
打赏
举报
回复
oracle中也有case when then else end和decode
wangzk0206
2007-03-07
打赏
举报
回复
select case when id=1 then 1 else 2 end case from t;
oracle
中
的if条件判断语句,SQL条件判断语句语法
条件判断语句可以作为程序段的逻辑结构跳转,根据不同条件执行不同的程序段,也可以在单条SQL语句内部使用,根据不同条件进行更新选择取值。三种数据库条件判断语句都有if和case,每种数据库语法存在些微差别。
oracle
:1、if语句:if condition thensql_statementelsif condition thensql_statementelsesql_statementend ...
oracle
动态条件查询语句,教您
Oracle
动态查询语句的用法
Oracle
动态查询语句是一类特殊的查询语句,下面就为您详细介绍
Oracle
动态查询语句的语法,如果您对
Oracle
动态查询方面感兴趣的话,不妨一看。1. 当使用EXECUTE IMMEDIATE语句处理单行查询时,需要使用INTO子句接受返回数据:DECLAREquery_statVARCHAR2(100):='SELECT*FROMemp'||'WHEREempno=:eno';emp...
oracle
中
的
条件语句
oracle
中
case when then及decode用法 一.case … when … then 语法: –
写
法一: case(条件) when 值1 then 返回值1 when 值2 then 返回值2 else 缺省值 –
写
法二: case when 条件1 then 返回值1 when 条件2 then 返回值2 else 缺省值 end; 案例1: --...
Oracle
条件语句
条件语句
主要作用是根据条件的变化选择执行不同的代码。 1、if语句 【实例】指定一个月份数值,然后使用if...then...elsif语句判断它所属的季节,并输出季节信息。 declare month int:=10; --定义整型变量并赋值 begin if month>=0 and month<=3 then --判
oracle
中
判断
条件语句
怎么
写
,
Oracle
的sql语句多条件判断
就需要多条件下面是一个多条件判断的sql:Sql代码 selectoper.opid,oper.user_name,oper.user_host,casewhen oper.oper_type = 1 then 'System Manager'when oper.oper_type = 2 then 'USER Manager'end case,casewhen oper.ope...
基础和管理
17,380
社区成员
95,113
社区内容
发帖
与我相关
我的任务
基础和管理
Oracle 基础和管理
复制链接
扫一扫
分享
社区描述
Oracle 基础和管理
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章