Simulate GROUP_CONCAT function in HSQLDB versions < 2?

微笑、不失礼 提交于 2019-12-13 02:50:08

问题


LO/OOO Base doesn't come with an HSQLDB version > 2 which means there is no GROUP_CONCAT function.

Is there a way to simulate this function in HSQLDB versions < 2?

Here's an example for the columns name and value before the function is applied:

TIM   |  51
TIM   |  53
TIM   |  55
JOHN  |  103
JOHN  |  104

I would like to use (H)SQL code in Base that returns something similar to the result of GROUP_CONCAT:

TIM   | 51, 53, 55
JOHN  | 103, 104

(A similar question has been asked for other DBMS but the answers did't work for me in HSQLDB.)


回答1:


There is no practical way to do this with HSQLDB 1.8.0.

You can, however, replace the jar that is supplied with LO/OOo with HSQLDB 2.2.9 (release candidate atm) and create and use external HSQLDB databases. Existing databases can also be converted.

See the http://www.ooofoum.org for detailed instructions and helper programs. A short guide is here: http://user.services.openoffice.org/en/forum/viewtopic.php?f=83&t=17567

Update: The latest HSQLDB 2.2.9 release candidate can be used with LO/OOo. The database embedded in an .odb file is updated to the new version and the file cannot be opened without the latest HSQLDB.



来源:https://stackoverflow.com/questions/11660432/simulate-group-concat-function-in-hsqldb-versions-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!