SELECT weight AS weight_delta from (select max(weight) from patients where last_name='Maroni') - (select min(weight) from patients where last_name='Maroni');
P粉6396675042024-03-29 00:53:00
You are thinking too complicatedly. Find the difference without any subquery:
SELECT MAX(weight) - MIN(weight) AS weight_delta FROM patients WHERE last_name = 'Maroni';