SQL左连接去除左边重复的数据



select b.id,b.a1,b.a3,b.a4,b.c_kind_num,b.c_picurl1,b.c_info_title,t.c_picurl,t.c_type,b.g_id,
CONVERT(varchar(100), d_list_date, 23) as d_list_date,'1' linkurl from b_news b left Join
(
select s.*
from (
select *, row_number() over (partition by guid order by n_order) as group_idx
from T_UPFILES
) s
where s.group_idx = 1) t
on b.g_id=t.guid where b.c_kind_num='98' and b.n_is_active='1'


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM