[Solved] select id by the min and max (sql) [closed]

[ad_1]

You can use the MAX() and MIN() function to get the ids having largest and the id having smallest discount.

Select id,discount
from customer 
where discount=(select MAX(discount) from customer) OR discount=(select MIN(discount) from customer);

3

[ad_2]

solved select id by the min and max (sql) [closed]