读书人

substr() 不能跟在 group by 后求解

发布时间: 2012-03-15 11:50:38 作者: rapoo

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 是什么意思?
以第一列

读书人网 >Informix

热点推荐