Is there any way to get last entry from all tables? I even did not find way to query all tables, tried this:
SELECT * FROM *
Is there any way to get last entry from all tables? I even did not find way to query all tables, tried this:
SELECT * FROM *
Yeah, you can do whatever you want in SQL, this query will give you 10 last data from your table, there we go:
Example:
SELECT * FROM tablename ORDER BY id DESC LIMIT 10;
put table name and id number which is primary key. you can also put any number in LIMIT 5
like this!
SELECT TABLE_NAME` FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME RLIKE '_posts' ORDER BY TABLE_NAME DESC LIMIT 10`
think about the data which you want to fetch, so place the row's name after ORDER BY
. it's done!
don't forget to study in W3school.
Thanks!