Advertisement
fbinnzhivko

Untitled

Jun 16th, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.17 KB | None | 0 0
  1. select  c.id,c.title,m.id
  2. from chats as c
  3. join messages as m
  4. on m.chat_id=c.id
  5. where
  6. date(sent_on)<'2012-06-23' and
  7. substr(c.title,-1,1)='x'
  8. order by c.id asc,m.id asc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement