语句如下:
        select min(id),word,cName,groupID from V_NearWord_WordType group by groupID
我想显示min(id),word,cName,groupID 这几个字段,word,cName字段在数据库中是字符型的我怎么能把它们显示出来,加上函数后,例:min(word)可以出现,可是会出现对应上的错误,那位大哥大姐给个解决方法

解决方案 »

  1.   

     select   min(id),word,cName,groupID   from   V_NearWord_WordType   group   by  word,cName,groupID
      

  2.   


    select [id],word,cName,groupID from V_NearWord_WordType   
    where id=(select min(id) from V_NearWord_WordType   group   by   groupID )
      

  3.   

    select id,word,cName,groupID from V_NearWord_WordTy where id = ( select min(id) from V_NearWord_WordType group by groupID)
      

  4.   

    你的ID最好是Number类型的select * from (
    select id,word,cName,GourpID,
    Row_number()over(partition by GourpID order by id) NID 
    from V_NearWord_WordType
    ) tb where NID=1
      

  5.   

    我给出的是Oracle中的分析函数,如果你的是Sql的,那就用上面各位的吧。
      

  6.   

    谢拉;虽然还有点小错误,但还是解决拉 ,把where   id   =   (   select   min(id)   from   V_NearWord_WordType   group   by   groupID)中的=该成in 就好啦
      散分