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