sqlserver内部联接与4个表 [英] sqlserver inner join with 4 table
本文介绍了sqlserver内部联接与4个表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,
我有4张桌子
1)master :: id,name_id,prdct_id,city_id
2)employe :: name_id,name
3)product :: prdct_id,product
4)city :: city_id,city
现在如何执行内部联接以显示主表和其他3个表之间的数据.
请给我一个解决方案.....
提前thnx......................
hello,
i have 4 table
1)master::id,name_id,prdct_id,city_id
2)employe:: name_id,name
3)product::prdct_id,product
4)city::city_id,city
now how can perform inner join to show data between master table and other 3 table.
plese send me a solution.....
thnx in advance................
推荐答案
在id字段上使用带有连接的select语句
Use a select statement with joins on the id fields
SELECT E.Name, P.Product, C.City
FROM master M
INNER JOIN employe E
ON M.name_id = E.name_id
INNER JOIN ...
看看是否可以完成此操作.
See if you can finish this.
这篇关于sqlserver内部联接与4个表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文