首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > Informix >

substr() 不能跟在 group by 后,求解!该怎么解决

2012-03-15 
substr() 不能跟在 group by 后,求解!select substr(id,1,6),count(*) from tbl where (jkrq is null or j

substr() 不能跟在 group by 后,求解!
select substr(id,1,6),count(*) from tbl where (jkrq is null or jkrq<"10-1-2009") and (card not like 'a%') group by substr(id,1,6);
报错
201: A syntax error has occurred.
Error in line 1
Near character position 124

group by id 就可以 group by substr(id,1,6) 就报错! 求解!

[解决办法]
group by 1 是什么意思?
以第一列

热点排行