As I can get the maximum and the average of 2 columns the fields are:
name, price, quantity.
I want to get the maximum and the next one by category
As I can get the maximum and the average of 2 columns the fields are:
name, price, quantity.
I want to get the maximum and the next one by category
With this query it will work for you
SELECT MAX(campo_tabla) AS maximo, AVG(campo_tabla) FROM nombre_tabla WHERE nombre = 'nombre_variable'
Where a SELECT
is made with the fields you need, MAX
makes the search the maximum record found in your table, AVG
takes the average WHERE nombre = 'nombre_variable'
if you need the maximum for each < strong> name WHERE nombre = 'nombre_variable'
you can do it with where
Greetings.