The next time a user enters the system, recommended to him, "he has not seen" video, tell me,,, how to get ah ~ ~ ~ ~
CodePudding user response:
Select id from a left join b on Anderson, d=b.i d where b.i d is not nullCodePudding user response:
A watch video
B table history record
SELECT * FROM A
WHERE A. Video ID not in (SELECT video ID FROM B)
CodePudding user response:
Select * from video vWhere not the exists (
Select 1 from view_record vr
Where vr. Video_id=v.i d and vr. User_id=# {username}
)