Here's the code that I'm trying with but the results were not correct or only showing the column with names:
sql = ("Select * from (Select name, SCORES from Table 1 where SCORES>0 order by SCORES) "
"UNION ALL "
"Select * from (Select name, SCORES from Table 2 where SCORES >0 order by SCORES) "
"ORDER BY SCORES DESC Limit 10")
Here's a sample of table 1
| name | Gender | SCORES |
|---|---|---|
| Steve | Male | 1200 |
| Robert | Male | 1600 |
Here's a sample of table 2
| name | Gender | SCORES |
|---|---|---|
| Cindy | Female | 3500 |
| Judy | Female | 4500 |
Simply
UNION ALLthe tables, order by scores descending, and pick the 10 first rows: