0

当国家名称的长度大于货币名称的长度时,尝试将字段字符转换为大写时出现以下错误。

ORA-00923: FROM keyword not found where expected
00923. 00000 -  "FROM keyword not found where expected"

这是我使用的 SQL 语句:

 select 
 countryname.country, countryname.currencycode, currency.currencyname
 case(
 when length(countryname.country)> length (currency.currencyname) 
 then UCASE(countryname.country)
 else
 LCASE(countryname.country)
 )end     
 from  currency,countryname
 where currency.currencycode=COUNTRYNAME.currencycode;
4

3 回答 3

2

尝试在第一个之后添加逗号currencyname,并删除case关键字后的括号:

select 
 countryname.country, countryname.currencycode, currency.currencyname,
 case
 when length(countryname.country)> length (currency.currencyname) 
 then UCASE(countryname.country)
 else
 LCASE(countryname.country)
 end     
 from  currency,countryname
 where currency.currencycode=COUNTRYNAME.currencycode;
于 2013-04-20T17:14:53.013 回答
1

您在 currency.currencyname 之后缺少逗号

于 2013-04-20T14:00:06.153 回答
0

我不熟悉 oracle,但错误似乎指定了一个不同的问题。

会不会是你忘了在货币名称后面加一个“,”?

于 2013-04-20T14:01:07.013 回答