小编Lla*_*ama的帖子

(Oracle) IF 语句中的 IN 条件

我需要检查变量的值是否等于两个值之一。我可以在那里使用 IN 条件吗?

例子:

if (proc_stat in (ap_public.ap_tool.c_status_array(3), ap_public.ap_tool.c_status_array(1))) then
Run Code Online (Sandbox Code Playgroud)

sql oracle plsql

2
推荐指数
1
解决办法
2万
查看次数

SQL 查询对我来说太复杂了

我有一个带有note列的表,可以有值“开始”或“结束”。然后还有其他列,它们可以具有相同的值,但唯一的区别在于“注释”列...

我需要选择将“note”设置为“Start”的行,但只有那些行,没有具有相同值且“note”设置为“End”的行。抱歉,解释起来很复杂。我会尝试展示一些例子。

Coll1   Coll2   Coll3   note
-----------------------------
a       a       a       Start
a       a       a       End
b       b       b       Start
b       b       b       End
c       c       c       Start <- I need select those rows
-- There is no row with 'c c c End' combination in the table
d       d       d       Start
d       d       d       End
e       e       e       Start <- I need select those rows
-- There is no row with 'e e e End' combination in the …
Run Code Online (Sandbox Code Playgroud)

sql oracle

2
推荐指数
1
解决办法
152
查看次数

标签 统计

oracle ×2

sql ×2

plsql ×1