Left Join without duplicate rows from left table

前端 未结 3 909
夕颜
夕颜 2020-12-02 09:59

Please look at the following query:

tbl_Contents

Content_Id  Content_Title    Content_Text
10002   New case Study   New case Study
1         


        
3条回答
  •  悲哀的现实
    2020-12-02 10:29

    Using the DISTINCT flag will remove duplicate rows.

    SELECT DISTINCT
    C.Content_ID,
    C.Content_Title,
    M.Media_Id
    
    FROM tbl_Contents C
    LEFT JOIN tbl_Media M ON M.Content_Id = C.Content_Id 
    ORDER BY C.Content_DatePublished ASC
    

提交回复
热议问题