0
我有兩個表cafedetails
和employeedetails
連接兩個表在相同的條件下在SQL Server
cafedetails
已列cafemanagerid和STAFFID是employeedetails
有列僱員,employeename
我想全部細節
cafemanagerid, name, staffid, name
我的查詢:
select
cafemanagerid, employeename as cafemanagerName,
staffid, employeename as staffname
from
cafedetails, employeedetails
where
cafemanagerid = employeeid
and staffid = employeeid
我不知道工作,但如何實現這一目標?
幫助我..
[不良習慣踢:使用舊樣式的JOIN(http://sqlblog.com/blogs/aaron_bertrand/archive /2009/10/08/bad-habits-to-kick-using-old-style-joins.aspx) - 舊式*逗號分隔的表*樣式列表已替換爲* proper * ANSI'JOIN'語法在ANSI - ** 92 ** SQL標準(**超過20年**之前),並且不鼓勵使用它 –