SQL DISTinc 的难题
Sql= "select DISTINCT (UserID),Content,Title,RootID,JoinTime from Dv_Boke_Post where Content is not null and stype=0 order by JoinTime Desc "
我只想让记录集中不要存在相同的UserID
可是我上面这样写,怎么还会影响到Content字段呢
因为Content是ntext类型
真是搞不懂啊
后来这样写报是不会报错,可记录集里面还是会有重复的UserID
Sql= "select (UserID),Content,Title,RootID,JoinTime from Dv_Boke_Post where Content is not null and stype=0 and [userid] in (select distinct [userid] from Dv_Boke_Post) order by JoinTime Desc "
请您快帮帮我啊