这样写
select substr(sc_id,0,2),sc_content
  from
      sms_content
  group by substr(sc_id,0,2),sc_content

解决方案 »

  1.   

    不能这么写group by语句
    -------------
    select col,sum(...) from table group by col
      

  2.   

    我知道你的意思,是取出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));
      

  3.   

    谢谢:kerisyml(魂之利刃) jiezhi(西域浪子) 两位
      

  4.   

    至: kerisyml(魂之利刃)
    查复后,你提供的那个sql语句,找出所有的记录,不正确哦
    要求就是: 取出sc_id的前两位,对他们分类排序