【转】MyBatis中Like语句使用方式

http://www.cnblogs.com/littleCode/p/3727476.html

oracle数据库:

  1. SELECT
  2. *
  3. FROM
  4. user
  5. WHERE
  6. name like CONCAT('%',#{name},'%')

  1. SELECT
  2. *
  3. FROM
  4. user
  5. WHERE
  6. name like '%'||#{name}||'%'

SQLServer数据库:

  1. SELECT
  2. *
  3. FROM
  4. user
  5. WHERE
  6. name like '%'+#{name}+'%'

mysql数据库:

  1. SELECT
  2. *
  3. FROM
  4. user
  5. WHERE
  6. name like CONCAT('%',#{name},'%')

DB2数据库:

  1. SELECT
  2. *
  3. FROM
  4. user
  5. WHERE
  6. name like CONCAT('%',#{name},'%')

    1. SELECT
    2. *
    3. FROM
    4. user
    5. WHERE
    6. name like '%'||#{name}||'%'
上一篇:CUDA error: device-side assert triggered


下一篇:Ubuntu mysql