DB2 与mysql sql语句对此

DB2语法与mysql语法比较

模糊搜素:
mysql: concat (‘%’,#{***},‘%’)

DB2:like ‘%‘|| #{***}||‘%’

dateRange时间段选择:
mysql: <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 --> and date_format(***,%y%m%d)>=date_format(#{beginTime},%y%m%d) </if> <if test="endTime != null and endTime != ''"><!-- 结束时间检索 --> and date_format(***,%y%m%d)<=date_format(#{endtime},%y%m%d)

DB2: <if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 --> and **** &gt;= #{beginTime} </if> <if test="endTime != null and endTime != ''"><!-- 结束时间检索 --> **** &lt;= #{endTime} </if>

posted @ 2020-11-05 16:05  sophial  阅读(219)  评论(0)    收藏  举报