Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql 如何使用distinct将group_concat添加到hsqldb?_Mysql_Sql_Unit Testing_Hsqldb_Group Concat - Fatal编程技术网

Mysql 如何使用distinct将group_concat添加到hsqldb?

Mysql 如何使用distinct将group_concat添加到hsqldb?,mysql,sql,unit-testing,hsqldb,group-concat,Mysql,Sql,Unit Testing,Hsqldb,Group Concat,我正在尝试将group_concat函数添加到hsqldb中,以便能够正确地将查询作为单元/集成测试进行测试。该查询在mysql中运行良好,因此我需要它在hsqldb中运行(希望如此) 添加此聚合函数可以解决大部分问题。它将正确地表现为mysql的group_concat。但是,它不会做的是让我像这样使用distinct关键字: group_concat(distinct column) 有没有办法加入distinct关键字?还是重写查询以完全避免使用distinct关键字?HSQLDB具有内

我正在尝试将group_concat函数添加到hsqldb中,以便能够正确地将查询作为单元/集成测试进行测试。该查询在mysql中运行良好,因此我需要它在hsqldb中运行(希望如此)

添加此聚合函数可以解决大部分问题。它将正确地表现为mysql的group_concat。但是,它不会做的是让我像这样使用distinct关键字:

group_concat(distinct column)

有没有办法加入distinct关键字?还是重写查询以完全避免使用distinct关键字?

HSQLDB具有内置的GROUP CONCAT并接受distinct


目前,您无法向用户定义的聚合函数中添加DISTINCT,但这看起来是一个将来可以使用的有趣功能。

我目前正在使用2.0.0,但它似乎没有。也许你指的是更新的版本?我不能使用2.2.x行,因为某种原因,当dbunit插入数据时,我的单元测试会慢得多。2.0.0的速度似乎快了8-10倍。我编写查询是为了与一个子选择连接,该子选择首先获取同义词,以避免使用distinct。这似乎解决了问题,但我希望这不会使速度变慢。也许您需要增加JVM内存。2.2.9在mem:数据库中12秒内插入400万行。
group_concat(distinct column)