Select the difference between the maximum and minimum weight of a person with the last name Maroni.
P粉5643017822024-03-28 12:25:10
0
1
388
SELECT weight AS weight_delta
from (select max(weight)
from patients
where last_name='Maroni')
-
(select min(weight)
from patients
where last_name='Maroni');
You are thinking too complicatedly. Find the difference without any subquery: