cakephp 与 oracle:没有分组依据?

发布于 2024-08-06 03:22:27 字数 715 浏览 3 评论 0原文

您好,

我正在尝试使用“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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

南冥有猫 2024-08-13 03:22:27

这是最近修复的已知问题。检查此链接

This is a known problem that was recently fixed. Check this link

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文