0

我正在寻找 Mysql 的 find_in_set 的 derby 等价物。在 mysql 中,

SELECT FIND_IN_SET('b','a,b,c,d');

我计划将 db 从 mysql 迁移到 derby。如何为德比实现它?由于逗号分隔的字符串被视为一个集合,因此 locate() 函数无法实现相同的效果。谢谢。

4

1 回答 1

0

This might be a good use of Derby's CREATE FUNCTION feature: http://db.apache.org/derby/docs/10.9/ref/rrefcreatefunctionstatement.html

Create a custom function in Derby which implements the mysql FIND_IN_SET function.

You might try asking on the derby-user mailing list; some other user might have already written such a function.

于 2013-03-26T13:58:16.610 回答