Deleting unneeded rows from a table with 2 criteria?

ORDER BY `time` DESC LIMIT 0, 5) AS TAB)) so it should delete only the records that aren't contained in the two SELECT that you need.

This requires me to give it an user id. So it will keep the required number of rows only for this user. The others may get removed.

– stormbreaker Jan 9 at 16:40.

I'm closing this question. I didn't find the answer I was looking for but ended doing it another way. I decided to remove these records that are 2 days old so there won't be any unused rows in the database.

I have a many-to-many relations table and I need to DELETE the unneeded rows. This table logs the last users which viewed the document. (user, document) is unique.

However, now I need to also show the last 5 documents a user has viewed.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions