sql取出数据唯一列,无重复列

SELECT cxljdzj_id AS id,cxljdzj_yp_id,cxljdzj_title from cxljdzj_news 

WHERE  [cxljdzj_ypxxone_id]=39 and cxljdzj_panduan!=0 AND

cxljdzj_id in(SELECT max(cxljdzj_id) as [max] FROM  

cxljdzj_news WHERE  [cxljdzj_ypxxone_id]=39 and cxljdzj_panduan!=0 GROUP BY cxljdzj_yp_id ) 

order by cxljdzj_yp_id desc

posted @ 2014-01-16 17:03  武二郎  阅读(334)  评论(0编辑  收藏  举报