我有4个表,我想从4个表中获取数据 [英] I have 4 tables in the I want to get the data from the 4 tables
本文介绍了我有4个表,我想从4个表中获取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
i希望得到每个表中的一列,4个表中的常见id是project_code是常见的列可以提供查询
我尝试过:
i没有尝试这个我是新的这个sql
解决方案
尝试:SELECT a.ColumnName,b.ColumnName,c.ColumnName,d.ColumnName
FROM tbl1 a
JOIN tbl2 b ON a.project_code = b.project_code
加入 tbl3 c ON a.project_code = c.project_code
JOIN tbl4 d < span class =code-keyword> ON a.project_code = d.project_code
i have 4 tables names are tbl1,tbl2,tbl3.tbl4
i want to get the one one column from the each table common id in the 4 tables are project_code is the common column could give the query
What I have tried:
i didn't try this one i am new this sql
解决方案
Try:SELECT a.ColumnName, b.ColumnName, c.ColumnName, d.ColumnName FROM tbl1 a JOIN tbl2 b ON a.project_code = b.project_code JOIN tbl3 c ON a.project_code = c.project_code JOIN tbl4 d ON a.project_code = d.project_code
这篇关于我有4个表,我想从4个表中获取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文