我有两个不同的表,例如table1
和table2
,因为我有一个共同列customer_id
,然后我想从customer_loan
中选择table1
和来自customer_name
的{{1}}使用公共列table2
并加入并显示在我的页面中,任何人都可以帮助我
答案 0 :(得分:1)
很简单
SELECT table1.customer_loan,table2.customer_nam
FROM table1 INNER JOIN table2 ON (table1.customer_id =table2.customer_id)
答案 1 :(得分:0)
试试这个
select table1.customer_loan,table2.customer_nam from table1 inner join table2 on table1.customer_id = table2.customer_id
答案 2 :(得分:0)
您需要JOIN
,如下所示:
SELECT table1.customer_loan, table2.customer_nam
FROM table1 JOIN table2
USING (customer_id)