不能这么写group by语句 ------------- select col,sum(...) from table group by col
我知道你的意思,是取出sc_id的前两位,对他们分类排序,如果这样,用我上面的SQL语句也不行。用下面这个OK: select sc_id,sc_content from sms_content where substr(sc_id,0,2) in (select substr(sc_id,0,2) from sms_content group by substr(sc_id,0,2));
-------------
select col,sum(...) from table group by col
select sc_id,sc_content from sms_content where substr(sc_id,0,2) in (select substr(sc_id,0,2) from sms_content group by substr(sc_id,0,2));
查复后,你提供的那个sql语句,找出所有的记录,不正确哦
要求就是: 取出sc_id的前两位,对他们分类排序