我是關係數據庫的新手...... 我想在同一個數據庫中列出許多表中的所有數據。在MySQL中嵌套select語句
我有一個包含其他表的NAMES的表。就像這樣:
mysql> select * from CarKeys;
+-------+
| Name |
+-------+
| Audi |
| Honda |
+-------+
mysql> select * from Audi;
+-------+---------+--------+
| Model | NumDoor | Colour |
+-------+---------+--------+
| A4 | 4 | White |
+-------+---------+--------+
mysql> select * from Honda;
+------------+---------+--------+
| Model | NumDoor | Colour |
+------------+---------+--------+
| Civic | 4 | White |
| Civic | 4 | White |
| HomdaModel | 5 | Red |
+------------+---------+--------+
但現在,我不希望被調用select * from Honda
和select * from Audi
seperately。 我想,這將select * from
命名CarKeys
表
我想這中所有表的一個命令:
SELECT * FROM (SELECT * FROM CarKeys);
,但我得到了這樣的錯誤消息:
ERROR 1248 (42000): Every derived table must have its own alias
我怎麼能得到所有此數據庫中所有表的信息?我正在使用的Schema的名稱是WebApp
錯誤的數據庫設計 –