Skip to content
Advertisement

Problems with SQL syntax? MAX not working

postid is a increasing numeric value (1,2,3...). At the moment, the highest value is 49, but It’s pulling up 1. It seems to be ignoring the MAX statement.

otherwise everything else is working great.

Advertisement

Answer

That’s not valid syntax, which engine is running it?

You either need:

to get multiple records, one for each title, showing the max postid for each title, or

to get the single max postid from the table.

If you want the highest postid and the title that goes with it, you need

or

depending on your SQL engine.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement