[英]#1064 - You have an error in your SQL syntax; ....." ...INNER JOIN"
SELECT
COUNT(IPD_Admit_Register_Det.BID) AS BID,
Bed_WardList.WID, Bed_FloorList.FID
FROM
Bed_BedList
INNER JOIN shift_last_bed
INNER JOIN IPD_Admit_Register_Det
ON shift_last_bed.IPDid = IPD_Admit_Register_Det.IPDid
AND shift_last_bed.IDPdid = IPD_Admit_Register_Det.IPDdid
ON Bed_BedList.BID = IPD_Admit_Register_Det.BID
INNER JOIN Bed_FloorList
INNER JOIN Bed_WardList
ON Bed_FloorList.FID = Bed_WardList.FID
ON Bed_BedList.WID = Bed_WardList.WID
GROUP BY
IPD_Admit_Register_Det.BID,
Bed_WardList.WID,
Bed_FloorList.FID
above query is execute successfully in mssql server 2008 but when same doing in MySql using phpMyAdmin it throws error like上面的查询在 mssql server 2008 中成功执行,但是当使用 phpMyAdmin 在 MySql 中执行相同操作时,它会抛出如下错误
1064 - You have an error in your SQL syntax;
1064 - 您的 SQL 语法有误; check the manual that corresponds to your MariaDB server version for the right syntax to use
查看与您的 MariaDB 服务器版本对应的手册,了解要使用的正确语法
near 'ON Bed_BedList.BID = IPD_Admit_Register_Det.BID INNER JOIN Bed_FloorList INNER J' at line 5
在第 5 行靠近“ON Bed_BedList.BID = IPD_Admit_Register_Det.BID INNER JOIN Bed_FloorList INNER J”
Guys Appreciate your help!伙计们感谢您的帮助! finally I got proper query as below
最后我得到了如下正确的查询
SELECT
COUNT(IPD_Admit_Register_Det.BID) AS BID,
Bed_WardList.WID, Bed_FloorList.FID
FROM
shift_last_bed,
IPD_Admit_Register_Det,
Bed_BedList,
Bed_FloorList,
Bed_WardList
WHERE
(shift_last_bed.IPDid = IPD_Admit_Register_Det.IPDid)
AND (shift_last_bed.IPDdid = IPD_Admit_Register_Det.IPDdid)
AND (Bed_BedList.BID = IPD_Admit_Register_Det.BID)
AND (Bed_FloorList.FID = Bed_WardList.FID)
AND (Bed_BedList.WID = Bed_WardList.WID)
GROUP BY
IPD_Admit_Register_Det.BID,
Bed_WardList.WID,
Bed_FloorList.FID
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.