我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

Doctrine countDistinct别名

How i can set an alias for a countDistinct expr using Doctrine queryBuilder?

$qb->addSelect($qb->expr()->countDistinct('_charges.id'));

You can't. Here's what the countDistinct function returns:

return 'COUNT(DISTINCT ' . implode(', ', func_get_args()) . ')';

You could however directly call the select function like this:

select('COUNT(DISTINCT _charges.id) AS charges')

近期文章

  • bundle install 报错
  • 顺序表查找元素失败 VS2019
  • Java idea 连接sqlserver服务器失败
  • 用数学函数怎么打代码
  • 为什么有两个连接池对象,只连了一个MySQL
  • 求一个Matlab/Simulink教程
  • for循环出多个单选框,但选中的时候是一起变的,怎么让他们自己变自己的呀
  • 提示未使用的import语句
  • substring失效
  • 使用php将数据存储到文本文件中?
  • C语言鸡兔同笼 for循环结构
  • 使用vs code ssh 连接服务器出现问题
  • C++问题,clock类排序
  • 字符串指针释放free
  • 在python中创建函数
  • sql数据库有订单id和雇员id怎么计算雇员销售的订单总数
  • tomcat10无法与httpd2.4通过ajp协议连接
  • MYSQL从5个相同的值中只选择1个
  • C语言中的函数问题 素数求法
  • 单链表的初始化和建立的区别

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华