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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2023408/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 05:00:10  来源:igfitidea点击:

How to implement the greater than or equal SQL statement in iBatis?

sqlibatis

提问by Stephane Grenier

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

让我们在我的 sql 语句中说我想做:

WHERE numberOfCookies >= 10 

How do I do this in iBatis?

我如何在 iBatis 中做到这一点?

回答by Stephane Grenier

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

<少于

回答by Tinister

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 中表现不佳。在这种情况下,您可以将整个语句包装在<![CDATA[ ... ]]>