Groovy FindAll 语句用于查找不存在的值
我正在尝试构建一个 Groovy 语句来查找预填充列表中不存在的值。
我正在使用 SQL 并且认为我想做类似的事情:
myList = [a, b, c, d, e ... lots more data]
sql.findAll("SELECT * FROM table WHERE code not in " + <myList>)
我有一种感觉这非常简单..我只是不确定如何构建闭包。
还欢迎有关如何执行此操作的任何其他建议..
感谢您的任何见解..
I am trying to construct a Groovy statement to find values that don't exist in a pre-populated list.
I'm using SQL and think I want to do something like :
myList = [a, b, c, d, e ... lots more data]
sql.findAll("SELECT * FROM table WHERE code not in " + <myList>)
I have a feeling this is very simple .. I'm just not sure how to construct the closure.
Also open for any other suggestions on how to do it ..
Thanks for any insight ..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
sql 语句中
myList
的值应该是逗号分隔的值列表。您最终希望您的查询看起来像您尝试过这样的事情吗?
The value of
myList
in the sql statement should be a comma separated list of values. You eventually want your query to look likeHave you tried something like this?