Answer the question
In order to leave comments, you need to log in
How to create a selection for an activity feed in MySQL?
Gentlemen, next question.
There are 5 tables, you need to collect information about them together and sort by date.
The problem comes when I join tables like this:
SELECT l . * , f . *
FROM user t
INNER JOIN likes l ON t.id = l.author
INNER JOIN follow f ON t.id = user_id
WHERE t.id =5
LIMIT 0 , 30
Answer the question
In order to leave comments, you need to log in
So why do you have INNER at the top and LEFT at the bottom? Use INNER.
If columns are duplicated, then select only the ones you need, and not
In order not to duplicate lines, first do a JOIN instead of Left Join, if there are duplicates anyway, then look for the difference in these lines (it should be, and I suspect that you have jambs with dates there)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question