Guest User

Untitled

a guest
Apr 19th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.27 KB | None | 0 0
  1. SELECT cr1.entity_id, cr1.user_id, cr1.value
  2. FROM core_rating cr1
  3. where cr1.timestamp=(select max(cr2.timestamp) from core_rating cr2 where cr1.user_id = cr2.user_id)
  4. GROUP BY cr1.entity_id, cr1.user_id, DATE_FORMAT(cr1.timestamp, '%Y-%m-%d %h:%i:00')
  5. order by cr1.timestamp
Add Comment
Please, Sign In to add comment