Sorry It is my first time to join the family of CSDN.I made a mistake.The question is:Create a view base on table ATable Aid   description
1    AA      
1    ABC
2    BA
2    CBDD
2    DAAAThe result of view id   description
1    AA+ABC
2    BA+CBDD+DAAAthere is no rule in field 'description'.

解决方案 »

  1.   

    don't worry , here you are :http://expert.csdn.net/Expert/topic/1450/1450642.xml?temp=.7687647
    http://expert.csdn.net/Expert/topic/1320/1320296.xml?temp=.8047144
      

  2.   

    create function getresult(@id varchar(10))
    returns varchar(100)
    as 
    begin
    declare @result varchar(100)
    set @result=''
    select @result=@result+description from yourtable where id=@id
    return @result
    end语句:
    select distinct id,dbo.getresult(id) from yourtable