我正在开展一个大型项目并且我停留在新闻源SQL查询中,该查询带来了7个表中的数据,这里是加载重复数据的查询,或者没有任何内容可以帮助我吗
第一个是:
SELECT videos.videoID,videoTitle,videoDescription,videoUploadedDate,videoUploadedBy,languageID,videoViews,videoIsActive,members.firstName,members.lastName,members.imgName,categories.catName,categories.catID,subCategorie.subCatName,subCategorie.subCatID
FROM videos
INNER JOIN members ON videos.videoUploadedBy = members.memberID
INNER JOIN categories ON videos.videoCategory = categories.catID
INNER JOIN subCategorie ON videos.videoSubCategory = subCategorie.subCatID
LEFT JOIN videoSharing ON videos.videoID = videoSharing.videoID
LEFT JOIN subscribesCategies ON videos.videoCategory = subscribesCategies.catID
LEFT JOIN subscribesSubCategies ON videos.videoSubCategory = subscribesSubCategies.subCatID
LEFT JOIN subscribesMembers ON members.memberID = subscribesMembers.memberSubscribed
WHERE videoSharing.memberID = 1
OR subscribesCategies.memberID = 1
OR subscribesSubCategies.memberID = 1
OR subscribesMembers.memberSubscribed = 1
第二个是
SELECT videos.videoID,videoTitle,videoDescription,videoUploadedDate,videoUploadedBy,languageID,videoViews,videoIsActive,members.firstName,members.lastName,members.imgName,categories.catName,categories.catID,subCategorie.subCatName,subCategorie.subCatID
FROM videos
LEFT JOIN members ON videos.videoUploadedBy = members.memberID
LEFT JOIN categories ON videos.videoCategory = categories.catID
LEFT JOIN subCategorie ON videos.videoSubCategory = subCategorie.subCatID
LEFT JOIN videoSharing ON videos.videoID = videoSharing.videoID
LEFT JOIN subscribesCategies ON videos.videoCategory = subscribesCategies.catID
LEFT JOIN subscribesSubCategies ON videos.videoSubCategory = subscribesSubCategies.subCatID
LEFT JOIN subscribesMembers ON members.memberID = subscribesMembers.memberSubscribed
WHERE members.memberID = 2
第三名:
SELECT videos.videoID,videoTitle,videoDescription,videoUploadedDate,videoUploadedBy,languageID,videoViews,videoIsActive,members.firstName,members.lastName,members.imgName,categories.catName,categories.catID,subCategorie.subCatName,subCategorie.subCatID
FROM videos
LEFT JOIN members ON videos.videoUploadedBy = members.memberID
LEFT JOIN categories ON videos.videoCategory = categories.catID
LEFT JOIN subCategorie ON videos.videoSubCategory = subCategorie.subCatID
LEFT JOIN videoSharing ON videos.videoID = videoSharing.videoID
LEFT JOIN subscribesCategies ON videos.videoCategory = subscribesCategies.catID
LEFT JOIN subscribesSubCategies ON videos.videoSubCategory = subscribesSubCategies.subCatID
LEFT JOIN subscribesMembers ON members.memberID = subscribesMembers.memberSubscribed
WHERE videoSharing.memberID = 1
AND members.memberID = 1
AND subscribesCategies.memberID = 1
AND subscribesSubCategies.memberID = 1
AND subscribesMembers.memberSubscribed = 1
感谢。