Ibatis like MySQL Oracle sqlserver DB2

Source: Internet
Author: User

Article category:Java programming

I searched for ibatis's use of like on the Internet. I believe the xdjm in this article should also know how to solve it. I will not repeat it here. I just want to explain it again:

Leave '% $ xxx $ %' blank. The solution is as follows:

 

SQL code
  1. Select*
  2. FromUser
  3. WhereUsername like '%' | # username # | '%'
Select * from user where username like '%' | # username # | '%'

 

 


In fact, the above statement is correctOracleFor different data string connectors. MySQL and sqlserver are listed as follows:

MySQL:

 

SQL code
  1. Select*
  2. FromUser
  3. WhereUsername like Concat ('%', # username #, '% ')
Select * from user where username like Concat ('%', # username #, '% ')

 

 

Turn: http://lawuu.iteye.com/blog/230791


 Sqlserver:

SQL code
  1. Select*
  2. FromUser
  3. WhereUsername like '%' + # username # + '%'
Select * from user where username like '%' + # username # + '%'

 

 

 

Bytes -----------------------------------------------------------------------------------------------------------------------------

Some databases I have used are listed as follows:

 

Oracle Sqlserver MySQL DB2
| Or Concat () + Concat () | Or Concat ()

 

More string connectors for other databases: Google!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.