如何在KoolReport中以DISTINCT嵌套在COUNT中的方式编写选择查询?

问题描述

要实现这一目标

select count(distinct(SID)) from history where `Date` < '2020-08-19'

我最接近的是:

       $this->src("config")->query("select * from history")
           ->pipe(new Filter(array(
        array("`Date`","<",'2020-08-19')
        )))
       ->pipe(new Group(array(
               "by"=>array("SID"),"count"=>array("SID")
        )))
       ->pipe($this->dataStore("checkedsm"));

但是它仍然不起作用。

我如何达到最终目标?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)