select if STATE=1 then STATE:='未处理' else if STATE=1 then STATE:='已处理' end if from a
这样的写法错误。该怎么写??
9 个解决方案
#1
报错:ORA-00923: FROM keyword not found where expected
#2
SELECT
(CASE
WHEN STATE=1 THEN
STATE:='未处理'
WHEN STATE=1 THEN
STATE:='已处理'
ELSE
NULL
END) AS AAA
FROM A
(CASE
WHEN STATE=1 THEN
STATE:='未处理'
WHEN STATE=1 THEN
STATE:='已处理'
ELSE
NULL
END) AS AAA
FROM A
#3
select decode(STATE,1,'未处理','已处理') from a
#4
STATE:='未处理' 这块报错:
ORA-00905: missing keyword
ORA-00905: missing keyword
#5
select
decode(STATE,1,'未处理',2,'已处理', STATE)
from a
decode(STATE,1,'未处理',2,'已处理', STATE)
from a
#6
select
case
when state=1 then '已处理'
when state=2 then '未处理'
end case
from a
case
when state=1 then '已处理'
when state=2 then '未处理'
end case
from a
#7
decode()函數.
oracle 中的
if
elsif
end if
#8
正解
#9
elsif,不是else if
#1
报错:ORA-00923: FROM keyword not found where expected
#2
SELECT
(CASE
WHEN STATE=1 THEN
STATE:='未处理'
WHEN STATE=1 THEN
STATE:='已处理'
ELSE
NULL
END) AS AAA
FROM A
(CASE
WHEN STATE=1 THEN
STATE:='未处理'
WHEN STATE=1 THEN
STATE:='已处理'
ELSE
NULL
END) AS AAA
FROM A
#3
select decode(STATE,1,'未处理','已处理') from a
#4
STATE:='未处理' 这块报错:
ORA-00905: missing keyword
ORA-00905: missing keyword
#5
select
decode(STATE,1,'未处理',2,'已处理', STATE)
from a
decode(STATE,1,'未处理',2,'已处理', STATE)
from a
#6
select
case
when state=1 then '已处理'
when state=2 then '未处理'
end case
from a
case
when state=1 then '已处理'
when state=2 then '未处理'
end case
from a
#7
decode()函數.
oracle 中的
if
elsif
end if
#8
正解
#9
elsif,不是else if