[英]Database design for a father/husband name. Use one common column or separate columns to store the name?
[英]selecting database name, table name and column name.
MySql手冊指出 :
* 同樣,要從數據庫'db1'中的表't'和同一語句中的數據庫'db2'中的表't'中檢索,必須將這些表中的列稱為'db1.t.col_name'並且'db2.t.col_name'。*
如何創建這樣的選擇聲明?
對具有相同名稱但位於不同DB中的表使用不同的別名
select d1.col1, d2.col1
from db1.table1 d1
inner join db2.table1 d2 on d1.id = d2.id
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.