关于ORACLE查询列加()or () 报ORA-00923:未找找到要求的FROM关键字

来源:互联网 发布:js 设置 form action 编辑:程序博客网 时间:2024/06/07 01:49

SQL查询列中包含()() 执行的时候会报 ORA-00923:未找找到要求的FROM关键字,

ORACLE会默认列中别名非字母汉字的符号为特殊字符,需用" " 

例子:

SELECT  to_char(t.gmt_create,'YYYYMMDD HH24miss'订单时间,

t.card_name 姓名,

t.exchange_amount 金额(分),

t.card_index 卡索引,

t.core_trans_id 交易核心流水,

t.order_no 支付核心流水,

t.status 交易状态,

t.real_channel_id 渠道ID,

t.bank_resp_code 银行返回码,

t.bank_resp_msg 银行返回信息

  FROM fxo_withdraw_apply t

where t.core_trans_id  in (

'O0060005201610260000001287929160'

order by t.core_trans_id;

SELECT  to_char(t.gmt_create,'YYYYMMDD HH24miss'订单时间,

t.card_name 姓名,

t.exchange_amount 金额(分),

t.card_index 卡索引,

t.core_trans_id 交易核心流水,

t.order_no 支付核心流水,

t.status 交易状态,

t.real_channel_id 渠道ID,

t.bank_resp_code 银行返回码,

t.bank_resp_msg 银行返回信息

  FROM fxo_withdraw_apply t

where t.core_trans_id  in (

'O0060005201610260000001287929160'

order by t.core_trans_id;

SELECT  to_char(t.gmt_create,'YYYYMMDD HH24miss'订单时间,

t.card_name 姓名,

t.exchange_amount 金额(分),

t.card_index 卡索引,

t.core_trans_id 交易核心流水,

t.order_no 支付核心流水,

t.status 交易状态,

t.real_channel_id 渠道ID,

t.bank_resp_code 银行返回码,

t.bank_resp_msg 银行返回信息

  FROM fxo_withdraw_apply t

where t.core_trans_id  in (

'O0060005201610260000001287929160'

order by t.core_trans_id;

SELECT  to_char(t.gmt_create,'YYYYMMDD HH24miss'订单时间,

t.card_name 姓名,

t.exchange_amount 金额(分),

t.card_index 卡索引,

t.core_trans_id 交易核心流水,

t.order_no 支付核心流水,

t.status 交易状态,

t.real_channel_id 渠道ID,

t.bank_resp_code 银行返回码,

t.bank_resp_msg 银行返回信息

  FROM fxo_withdraw_apply t

where t.core_trans_id  in (

'O0060005201610260000001287929160'

order by t.core_trans_id;



解决方法:

SELECT  to_char(t.gmt_create,'YYYYMMDD HH24miss'订单时间,

t.card_name 姓名,

t.exchange_amount "金额(分)",

t.card_index 卡索引,

t.core_trans_id 交易核心流水,

t.order_no 支付核心流水,

t.status 交易状态,

t.real_channel_id 渠道ID,

t.bank_resp_code 银行返回码,

t.bank_resp_msg 银行返回信息

  FROM fxo_withdraw_apply t

where t.core_trans_id  in (

'O0060005201610260000001287929160'

order by t.core_trans_id;



5 0