为什么desc要加``呢
来源:4-4 商户模块_追踪源码,解决问题
田心枫
2017-07-05
<update id="update">
update business
<set>
<if test="title != null">
title = #{title},
</if>
<if test="subtitle != null">
subtitle = #{subtitle},
</if>
<if test="city != null">
city = #{city},
</if>
<if test="category != null">
category = #{category},
</if>
<if test="imgFileName != null">
img_file_name = #{imgFileName},
</if>
<if test="price != null">
price = #{price},
</if>
<if test="distance != null">
distance = #{distance},
</if>
<if test="desc != null">
`desc` = #{desc},
</if>
</set>
where id= #{id}
</update>为什么desc要加``呢
写回答
2回答
-
哈哈,好问题,你为什么不试试去掉【`】呢?然后再运行程序,看看会发生什么。
desc在一般关系型数据库中是什么意思?
那么在MySQL中,又是怎么解决的呢?
282018-03-26 -
假蛙工程师
2018-07-23
因为desc是mysql的关键字,对于这种关键字做列名或者表名的要用 ` ` 这个符号引起来,避免歧义
00
IT段子手详解MyBatis遇到Spring 秒学Java SSM开发大众点评
【毕设】SSM全面梳理,前后端分离,zTree 和复杂SQL打造权限系统,解惑MyBatis和RESTful
1001 学习 · 485 问题
相似问题