Check out example codes for "postgres select max value". It will help you in understanding the concepts better.

Code Example 1

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

Learn ReactJs, React Native from akashmittal.com