Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT wallMessage.message, wallMessage.author,
- wallMessage.id,
- `user`.name,
- `user`.surname,
- wallMessage.author,
- wallMessage.`date`,
- wallMessage.pulse
- FROM wallMessage
- JOIN (SELECT idOutgoing AS idFriend
- FROM `myFriends`
- WHERE idInput=6 AND STATUS = 1
- UNION
- SELECT idInput AS idFriend
- FROM `myFriends`
- WHERE idOutgoing=6 AND STATUS = 1) AS myFriendsOnly
- ON wallMessage.author = myFriendsOnly.idFriend
- LEFT JOIN `user` ON `user`.id = wallMessage.author
- WHERE wallMessage.author <> 6 or (CURRENT_TIMESTAMP - `wallMessage`.`date`) < TIMESTAMP( '0000-00-00 00:15:00')
- GROUP BY `id`
- ORDER BY `wallMessage`.`id` DESC limit 0, 15
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement