【发布时间】:2011-06-03 03:56:40
【问题描述】:
我是 Grails 标准构建器的新手,有人可以解释一下以下是什么意思吗?
def c = Account.createCriteria()
def results = c {
like("holderFirstName", "Fred%")
and {
between("balance", 500, 1000)
eq("branch", "London")
}
maxResults(10)
order("holderLastName", "desc")
}
是什么意思
-
Select * from account where holderFirstName like 'fred%' and (balance between 500 and 1000 **and** branch='london') -
Select * from account where holderFirstName like 'fred%' and (balance between 500 and 1000 **or** branch='london')
如果我想同时使用 "or" 和 "and" 我该怎么做?
【问题讨论】: