我有如下的sql查询
select transf, count(fname) from peak_info where fname in (select peakfile from pe_result where conid = 'GO:0006007' and fdr > 0.05) group by transf;
我想在 grails 中实现创建标准。目前,我首先在括号中运行 SQL 查询,然后运行如下外部查询:
def test2 = PeResult.createCriteria()
def ptest=test2.list {
eq("conid",conid.toString())
gt("fdr","0.05")
}
def peaknames = ptest.peakfile
def peakinfoFilter = PeakInfo.createCriteria()
def pifilter = peakinfoFilter.list {
'in'("fname", peaknames)
projections
{
groupProperty "transF"
count "fname"
}
}
我想知道是否有其他方法可以在一个查询中执行此操作而不是运行两个查询?