我有两个观点:
vbsleads.mview_leads
我想要显示的列列表
LEADDATE
LEADSID
FULLNAME
ADDRESS
SOURCENAME
MOBILEPHONE
PROBLEM
LEADASSIGNEDTO
vbsleads.view_validaccounts
我想要显示的列列表
UID
FIRSTNAME
我想在单个mysql查询中显示上面的列。我如何连接它们?
答案 0 :(得分:1)
尝试这样
SELECT mvl.LEADSID, mvl.LEADSID,mvl.FULLNAME,mvl.ADDRESS,mvl.HOURS_SPENT,
mvl.SOURCENAME,mvl.MOBILEPHONE,mvl.PROBLEM,mvl.LEADASSIGNEDTO,vv.UID,
vv.FIRSTNAME
FROM vbsleads.mview_leads mvl
JOIN vbsleads.view_validaccounts vv ON (mvl.COMPANYID=vv.COMPANYID)