DB 表字段 用了关键字导致error
Prod 环境出了一个ERROR, 还好功能没太多人使用。
原因:之前数据库做了迁移,MYSQL -> SQLSERVER
不知道谁在建表的时候,table 用了 column 'desc' 做为字段名,在mysql 上 select 数据正常。但在sql server 上 select 数据出现 error.
select a.desc from table a where 1=1
必须修改成这个才能运行通过。
select a.[desc] from table a where 1=1
desc明显的关键字,请小心使用。

浙公网安备 33010602011771号