-1

我有三个表,我想从中检索值,我使用下面的查询给我错误,谁能告诉我出了什么问题?

SELECT a.VISITOR_TEXT,a.COMPANY_TEXT,a.CONTACT,a.PERSON_TO_MEET,a.DEPARTMENT_TEXT,a.FLOOR,b.BELONGING_T
YPE,b.BELONGING_TEXT ,a.INTIME, c.EXIT_TIME FROM tm_visitor a  LEFT JOIN tm_belonging b , tm_exit c ON a.ID=b.
BID AND a.ID=c.ID;
4

3 回答 3

0
SELECT a.VISITOR_TEXT,a.COMPANY_TEXT,a.CONTACT,a.PERSON_TO_MEET,a.DEPARTMENT_TEXT,a.FLOOR,b.BELONGING_TYPE,b.BELONGING_TEXT ,a.INTIME, c.EXIT_TIME FROM tm_visitor a  
LEFT JOIN tm_belonging b ON a.ID=b.BID 
LEFT JOIN tm_exit c ON a.ID=c.ID;
于 2012-06-08T12:04:29.050 回答
0

这就是您要查找的内容:

SELECT  a.VISITOR_TEXT,
        a.COMPANY_TEXT,
        a.CONTACT,
        a.PERSON_TO_MEET,
        a.DEPARTMENT_TEXT,
        a.FLOOR,
        b.BELONGING_TYPE,
        b.BELONGING_TEXT,
        a.INTIME,
        c.EXIT_TIME 
FROM    tm_visitor a  
        LEFT JOIN tm_belonging b ON b.BID = a.id
        LEFT JOIN tm_exit c ON c.ID = a.ID
于 2012-06-08T12:05:16.810 回答
0

您不能使用,连接语法。仅在 from 语法中。采用

SELECT  a.VISITOR_TEXT, a.COMPANY_TEXT,a.CONTACT, a.PERSON_TO_MEET,a.DEPARTMENT_TEXT, a.FLOOR,b.BELONGING_TYPE,b.BELONGING_TEXT, a.INTIME, c.EXIT_TIME 
FROM tm_visitor a  
LEFT JOIN tm_belonging b  ON a.ID=b.BID
left join tm_exit c ON a.ID=c.ID
于 2012-06-08T12:05:24.307 回答