我的列名称带有特殊字符,例如“ TRUCK_#”。两个表“ shipment”,另一个是“ truck”。两者都有此“ TRUCK_#”列。我想对列“ TRUCK_#”执行联接

我已经写了这个查询

SELECT * FROM shipment RIGHT JOIN truck on shipment.TRUCK_#=truck.TRUCK_#


它给我一个错误的说法

Unknown column name 'shipment.TRUCK_' near ON


我认为它没有特殊性。谁能告诉我如何纠正它。提前感谢。

最佳答案

SELECT * FROM shipment RIGHT JOIN truck on `shipment`.`TRUCK_#`=`truck`.`TRUCK_#`

关于mysql - MySQL:在栏名称中加入特殊字符,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/22606118/

10-15 09:28