SELECT
`vehicleid`,
`companyvehicleid`,
`stocknumber`,
`year`,
`make`,
`model`,
FROM `vehicle`
WHERE `stocknumber` LIKE '100' LIMIT 20
错误是:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM `vehicle` WHERE `stocknumber` LIKE '100' LIMIT 20' at line 8
感谢。
答案 0 :(得分:1)
在select子句的末尾有一个额外的逗号。
答案 1 :(得分:1)
`model`, // this comma is the problem
FROM ...
,
之前有一个FROM
。
答案 2 :(得分:0)
SELECT
`vehicleid`,
`companyvehicleid`,
`stocknumber`,
`year`,
`make`,
`model`
FROM `vehicle`
WHERE `stocknumber` LIKE '100' LIMIT 20
model
之后你有一个逗号,这就是造成错误的原因。
答案 3 :(得分:0)
在SELECT语句的最后一列之后有一个逗号。尝试删除它。
答案 4 :(得分:0)
取出'model'和FROM
之间的最后一个逗号(,)