Skip to content
Advertisement

Pick the max value of id from multiple tables

I have 3 tables. Each of them have id column as PRIMARY.

There is no relation between tables.

I want to make a query which gives me the max id of every table.

What I have tried was this:

But I get NULL, NULL, NULL.

It is possible to done that? If yes, how?

Advertisement

Answer

MySQL syntax supports placing subqueries into the SELECT clause, so you could use:

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