What is the proper syntax for the Less Than/Equal operator in MyBatis 3?

Nwel picture Nwel · Aug 17, 2015 · Viewed 12.7k times · Source

How to use less than equal in MyBatis 3.

<select id="getLog" resultMap="BaseResultMap" parameterType="java.lang.String">
    SELECT * FROM(
        SELECT * FROM TABLE1
        WHERE COL1 =#{COL1,jdbcType=VARCHAR}
        ORDER BY DATE DESC
    ) TABLE2
    WHERE ROWNUM <= 20
</select>

Answer

Madness picture Madness · Aug 17, 2015

I show examples for the Greater Than/Equal Operator and the Less Than/Equal Operators:

ROWNUM &gt;= 20
ROWNUM &lt;= 20

Or, for readability, you can wrap them in CDATA

ROWNUM <![CDATA[ >= ]]> 20
ROWNUM <![CDATA[ <= ]]> 20