-3

my table is

+-----------+--------+--------+
| Name      | Weight | Height |
+-----------+--------+--------+
| Amin      |     75 |    180 |
| Mahdi     |     90 |    190 |
| Moahammad |     75 |    175 |
| Ahmad     |     60 |    175 |
+-----------+--------+--------+

I want sort a table from bigger Height and if Height is equal print lower weight first. and the result like this

Mahdi 190 90
Amin 180 75
Ahmad 175 60
Mohammad 175 75

1 Answers1

0

Use height as descending order then weight in ascending order

select name, hieght, weight
from tablename
order by height desc, weight
Fahmi
  • 36,607
  • 5
  • 19
  • 28