I’m using postgresSQL and would like to find the minimum value and the maximum value in one column. I have to have a column titled Order ID, Minimum Order, Maximum Order in the query. See the below code for what I have come up with. I want to return only 2 rows. Currently it is returning 2000 rows which is the entirety of the table.
SELECT ord_id AS Order_ID
,min (order_tot) AS Minimum_Order
,max(order_tot) AS Maximum_Order
FROM orders
GROUP BY Order_ID
ORDER BY minimum_order;'