SQL is a very powerful feature of MyBatis. It enables programmers to build queries based on to write the query using the
SQL language that can be used within any mapped SQL statement. Following are the OGNL based
SQL expressions provided by when, otherwise
• trim where, set
• foreach
## The if Statement
The most common thing to do in
SQL is conditionally include a part of a where clause. For example –