Write a query to display the second maximum payable amount who paid by the owner

Write a query to display the second maximum payable amount who paid by the owner .Give an alias name to the second maximum payable amount  as ‘second_max_payable_amount‘.

Write a query to display the second maximum payable amount who paid by the owner

Solution

SELECT MAX( payable_amount ) as second_max_payable_amount
FROM bill
WHERE payable_amount < ( SELECT MAX( payable_amount )
                FROM bill )

Output:

SECOND_MAX_PAYABLE_AMOUNT
		   724500

Happy Learning – If you require any further information, feel free to contact me.

Share your love
Saurav Hathi

Saurav Hathi

I'm currently studying Bachelor of Computer Science at Lovely Professional University in Punjab.

📌 Nodejs and Android 😎
📌 Java

Articles: 444

Leave a Reply

Your email address will not be published. Required fields are marked *