有没有一种方法可以在表的所有字段中搜索字符串,并根据找到字符串的位置返回一个字段?

xmd2e60i  于 2021-07-29  发布在  Java
关注(0)|答案(0)|浏览(143)

有没有一种方法可以在表中的所有字段上搜索字符串并返回链接到找到它的字段的字段?除了写一个when条件?
例如,在这个表中,我将搜索“审计结束日期”,然后返回日期所在的值。所以查询看起来像:

case
    when customfield1_name = 'date audit closed' then customfield1_value
    when customfield2_name = 'date audit closed' then customfield2_value
    when customfield3_name = 'date audit closed' then customfield3_value
end as 'datefield'

该表由50多个字段组成,其中字符串可以位于其中任何一个字段中。表示例,然后是值可能所在的另50个字段。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题