SQL语法错误错误

时间:2018-05-29 05:03:48

标签: sql

*这里我有两个表Site和SiteCoordinate。     和其他表格相互连接。

    Site.UniqueIDName,       /* Site table with different fields */
    Site.Name AS SiteName, 
    Site.MarkerName, 
    Site.MarkerNumber,
    SiteCoordinate.LocationLat,   /* SiteCoordinate Table with Different field */
    SiteCoordinate.LocationLong, 
    SiteCoordinate.LocationHeight,  /* I need to display both tables records */

在表格中创建和插入数据。

错误:

我在ON和Where附近发现了错误的语法错误。

FROM   SiteCoordinate **ON** SiteCoordinate.SiteID ON Site.ID = SiteCoordinate.SiteID Left OUTER JOIN /* Syntax error */   /* is this the correct syntax */
        vwStationConfiguration RIGHT OUTER JOIN
        vwSite RIGHT OUTER JOIN   /* Outer Join */ 
        Site ON vwSite.ID = Site.ID ON vwStationConfiguration.SiteID = Site.ID LEFT OUTER JOIN  /* Outer Join */ 
        vwSiteSensorInformation ON Site.ID = vwSiteSensorInformation.SiteId LEFT OUTER JOIN  /* Outer Join */ 
        Person RIGHT OUTER JOIN  /* Outer Join */ 
        SiteContact ON Person.ID = SiteContact.PersonID ON Site.ID = SiteContact.SiteID LEFT OUTER JOIN         
        Agency ON SiteContact.AgencyID = Agency.ID
WHERE   (SiteContact.SupportLevel = 1  or SiteContact.SupportLevel is NULL)

上面的代码是Inner Join和outer Join的示例。在此之前FROM SiteCoordinate ON SiteCoordinate.SiteID ON Site.ID = SiteCoordinate.SiteID Left OUTER JOIN //程序正常工作但在此行发现错误之后。

第二件事

**:XML ON**    /* incorrect syntax near ':'. */

0 个答案:

没有答案