postgres select max value 1

postgres select max value

SELECT * FROM payment
WHERE amount = (
 	SELECT
  	   MAX(amount)
	FROM
	   payment
);

Here is what the above code is Doing:
1. We’re selecting all the columns from the payment table.
2. We’re using a subquery to find the maximum amount in the payment table.
3. We’re using the subquery to find the row with the maximum amount.

Similar Posts