I am new to mysql and I need help.
I have 10 tables in my database.
On of them is called "sleep mode", and the circuit is similar to this.

The entity column contains the names of other tables in the database.
I need a query that will return me one row for each table, with 3 columns:
- table name
- max (id) tables
- next_hi column value in hibernate table for table
Like this:

It would be great if it could be done for each hibernate table and get the TableName from the entity column and get the MaxId for that TableName and return a row similar to the picture above using next_hi also
EDIT:
If this cannot be obtained by reading the table names from the "hibernate" table, this will also help if I can get this to work with table names locked in Query.
I have an example that I made for one table "Account":
SELECT hibernate.entity as TableName, hibernate.next_hi, MAX(Account.Id) as MaxId From Account INNER JOIN hibernate ON "Account"=hibernate.entity;
But now I do not know how to modify this query to return it for multiple tables.
source share