[英]How to get multiple columns value from all the tables in SQL
將前端創建的表的名稱存儲在另一個名為 user_tables 的表中。 利用:
SELECT table_name from user_tables
這將返回一個表名列表["table1", "table2", "table3"]
。 然后從表名列表中動態生成 sql:
SELECT group_name, date FROM table1
UNION
SELECT group_name, date FROM table2
UNION
SELECT group_name, date FROM table3
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.