How to properly form 1 MYSQL request



  • There's OBD. table How to make 1 request to remove 2 sets of 20 records of this format

    array1 ['name', 'likes', 'dislikes'] likes for a decrease of 10.9.8. ♪ ) array2 ['name', 'time_up'] time_up(unix_time) decrease



  • SELECT "like" `type`, * FROM `table_name` ORDER BY `likes` DESC LIMIT 20
    UNION SELECT "timeup", * FROM `table_name` ORDER BY `time_up` DESC LIMIT 20
    

    == sync, corrected by elderman ==

    (SELECT "like" `type`, a.* FROM `test1` a ORDER BY `likes` DESC LIMIT 20)
    

    UNION ALL (SELECT "timeup", b.* FROM test1 b ORDER BY time_up DESC LIMIT 20)


Log in to reply
 

Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2