cakephp 与 oracle:没有分组依据?
您好,
我正在尝试使用“group”参数来使用 CakePHP 进行查找。
dbms 是 oracle,令我惊讶的是它不起作用(查询中没有 group by)。
示例:
$this->User->find('all', array('group' => 'id'));
返回的查询:
select * from users User where 1 = 1;
在 DboOracle::renderStatement() 处挖掘源代码我发现:
return "SELECT {$fields} FROM {$table} {$alias} {$joins} {$conditions} {$order} {$limit}";
我很惊讶没有看到 {$group},所以我环顾四周,发现一些 dbo_ 文件确实有查询中包含 {$group},例如 dbo_source.php
return "SELECT {$fields} FROM {$table} {$alias} {$joins} {$conditions} {$group} {$order} {$limit}";
这是否意味着 cake 不支持 oracle 上的 group by 语句?还是有我不知道的解决方法?
Greetings,
I'm trying to use the 'group' parameter for a find using CakePHP.
The dbms is oracle and to my surprise it didn't work (no group by in the query).
Example:
$this->User->find('all', array('group' => 'id'));
The query returned:
select * from users User where 1 = 1;
digging around the source code at the DboOracle::renderStatement() I found this:
return "SELECT {$fields} FROM {$table} {$alias} {$joins} {$conditions} {$order} {$limit}";
I was surprised not seeing a {$group}, so I look around and found out that some of the dbo_ files do actually have {$group} included in the query, for example dbo_source.php
return "SELECT {$fields} FROM {$table} {$alias} {$joins} {$conditions} {$group} {$order} {$limit}";
Does this mean that cake doesn't support group by statement on oracle? Or is there a workaround that I'm not aware of?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是最近修复的已知问题。检查此链接
This is a known problem that was recently fixed. Check this link