Hi,
I have a table with product names and separate prices.
I want to show the distinct product names in alphabetical order, but at the same time show the cheapest price first.
I can of course use GROUP BY for the product names, but when I apply the order by PRODUCTNAME to the GROUP BY it will list the first product in the database and not the cheapest product. I can not use INNER JOIN as it is from one table.
I have tried so many things to get this potentially simple Query to work.
SELECT * FROM PRODUCTS
GROUP BY PRODUCTNAME order by PRODUCTNAME
I have a table with product names and separate prices.
I want to show the distinct product names in alphabetical order, but at the same time show the cheapest price first.
I can of course use GROUP BY for the product names, but when I apply the order by PRODUCTNAME to the GROUP BY it will list the first product in the database and not the cheapest product. I can not use INNER JOIN as it is from one table.
I have tried so many things to get this potentially simple Query to work.
SELECT * FROM PRODUCTS
GROUP BY PRODUCTNAME order by PRODUCTNAME
Comment