How to extract random entries from multiple mysql tables directly from database?

I am trying to extract a maximum of 5 entries randomly from two tables combined directly from database.

kinda like this SELECT RANDOM FROM table1,table2 LIMIT 0,5)

I am aware that I can filter the result later on from PHP, but I want only 5 random rows from database.

These multiple tables might have different database structure


Have you considered something like

(SELECT * from table1) union (select * from table2) order by rand() limit 0,5

Need Your Help

Display most recent project in concrete5

php concrete5 concrete5-5.7

I'm building a portfolio site for a graphic designer. The functionality is based on the portfolio in the Elemental theme (page list with thumbnails & page with slideshow and description for each

how to use TabID? dotnetnuke response.redirect navigateurl

i wanna access a link using tab id instead of Static URL as my URl is