Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. SELECT * FROM logs GROUP BY (order_id, log_name) ORDER BY order_id DESC LIMIT 0,1;
  2.  
  3. select distinct subtbl.Name from (select first_name + last_name as "Name" from log) as subtbl;
  4.  
  5. select subtbl.Name from (select first_name + last_name as "Name" from log) as subtbnl group by subtbl.Name limit 0, 1; -- this will take the first value
  6.  
  7. select * from log order by id desc limit 0, 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement