`

sql中oracle和mysql连接字符串的不同

    博客分类:
  • sql
阅读更多
以前用oracle链接字符串用 || 链接,最近开发中用到mysql链接字符的方法用 concat() 函数。
比如模糊查询中用到链接字符串oracle的方法是:
   <select id="getP2pCompanyInformationByName" parameterType="string" resultType="com.***.finance.share.p2p.entity.P2pCompanyInformation">
    	SELECT * FROM p2p_company_infomation where companyFullName like '%'||#{companyFullName}||'%'
   </select>

mysql中的方法是:
<select id="getP2pCompanyInformationByName" parameterType="string" resultType="com.***.finance.share.p2p.entity.P2pCompanyInformation">
    	SELECT * FROM p2p_company_infomation where companyFullName like CONCAT('%',#{companyFullName},'%')
   </select>

  
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics