将两个结果合并到一个具有不同条件的表中

时间:2019-05-25 09:38:28

标签: mysql

在一个具有不同条件的表中合并两个结果

我想将两个代码结果合并为1

代码1

SELECT id as myid
     , youtuber1_score as myscore
     , FIND_IN_SET( youtuber1_score, (    
           SELECT GROUP_CONCAT( youtuber1_score
           ORDER BY youtuber1_score DESC ) 
           FROM users_db )
          ) AS myrank
  FROM users_db
 WHERE id =  '44'

代码2

SELECT id as topscore_id
     , fname as topscore_firstname
     , lname as topscore_lastname
     , youtuber1_score as topscore_score 
  FROM users_db 
 WHERE youtuber1_score=(
SELECT max(youtuber1_score) FROM users_db
)

将结果合并到一张表中

0 个答案:

没有答案