如何在iBatis中实现大于或等于的SQL语句?

时间:2022-09-02 15:13:47

Let's say in my sql statement I want to do:

假设在我的sql语句中,我想这样做:

WHERE numberOfCookies >= 10 

How do I do this in iBatis?

我在iBatis是怎么做的?

2 个解决方案

#1


44  

Because the SQL is written in xml, you cannot just use the symbol ">", you need to write it as:

由于SQL是用xml编写的,所以不能只使用“>”符号,需要将其写成:

WHERE numberOfCookies >= 10

Update:

更新:

> for greater than

比;更大的比

< for less than

& lt;不到

#2


6  

Why does it not work?

为什么它不能工作?

The only thing I can think of is that the > character isn't playing nice with the XML. In which case, you can wrap the entire statement within <![CDATA[ ... ]]>

我能想到的唯一一件事是>字符不能很好地使用XML。在这种情况下,您可以在…

#1


44  

Because the SQL is written in xml, you cannot just use the symbol ">", you need to write it as:

由于SQL是用xml编写的,所以不能只使用“>”符号,需要将其写成:

WHERE numberOfCookies &gt;= 10

Update:

更新:

&gt; for greater than

比;更大的比

&lt; for less than

& lt;不到

#2


6  

Why does it not work?

为什么它不能工作?

The only thing I can think of is that the > character isn't playing nice with the XML. In which case, you can wrap the entire statement within <![CDATA[ ... ]]>

我能想到的唯一一件事是>字符不能很好地使用XML。在这种情况下,您可以在…