I want to select multiple tables with MySQL.
But I don’t know exactly the name of them, but they have all the same structure.
For example:
table_345:
id || row_1 || row_2 || row_3
I want to have something like that:
SELECT `id` FROM table_*
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you are using PHP with your MySQL database you can use mysql_list_tables() to get the list of tables in your database. That list can then be filtered easily using strpos(). Once you have your list of tables, you can use SQL UNION to combine the result sets from your tables.
I hope there’s a really good reason for you to choose this kind of design since it could get really ugly, really fast.
Good luck.