I have a table that has these columns, compra
purchase date serial y
serial date query` :.
Necesito sacar los datos de
y
de acuerdo a la última
he intentado hacerlo mediante este
SELECT compra,serial FROM warehouse where MAX(fecha);
But it sends me this error:
group function is not allowed here
I don't need to obtain the information by means of an id or something similar, only the last purchase and serial according to the date.
Or you can put the subquery inside a CTE (if your manager supports this feature) being like this
Later you make the
SELECT
end of the alias that you created calledMaxDate
, leaving all your code in this wayYou could do a select inside your where:
Greetings, I suggest you do the following:
I suggest you check the following: Max date