用户:
UserID | UserName
--------------
1 Jack
2 Evelin
商店:
ShopID | ShopName | ShopUserID
-------------------------------
1 Prague 1
2 Berlin 2
可以自动更新表格:
ShopID | ShopName | ShopUserID
-------------------------------
1 Prague Jack
2 Berlin Evelin
我可以使用触发器吗?
谢谢!
答案 0 :(得分:0)
请使用加入请尝试此查询:
Select s.shopID,s.ShopName,u.UserName from Shop as s Left Join Users as u on s.ShopUserID = u.UserID
输出将如下所示:
ShopID | ShopName | UserName
-------------------------------
1 Prague Jack
2 Berlin Evelin