作者valda (valda)
看板Database
标题[SQL ] 请问有了解informix的高手吗?
时间Sat Aug 17 02:08:37 2013
大家好
之前专案都是接触oracle与sql server
第一次使用informix
遇到个问题
select
xxxx
,case when col1='xx' then value else null end case
from
(
select * from tablename where col1 in ('xx','xxx')
)
这样执行是可以的
但是,一但alias column name就会出错
select
xxxx
,(case when col1='xx' then value else null end case) as newname
from
(
select * from tablename where col1 in ('xx','xxx')
)
请问该语法要如何下才可以alias column name呢?
感谢
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.132.55.158
1F:推 NullLife:case到end应该就结束了 你後面挂的case就是别名吧@@? 08/18 13:57
2F:推 wilsmart:同楼上 08/19 13:18