SELECT MESSAGE_ID, SHORTDESC
FROM VERNACULAR_MASTER
WHERE position( chr(10), SHORTDESC, CODEUNITS16)>0
or position( chr(13),SHORTDESC, CODEUNITS16)>0
以上查询采用db2格式。如何将其转换为oracle格式?
答案 0 :(得分:0)
与DB2的POSITION( search_string, source_string, encoding )
函数相当的是Oracle的INSTR( string, sub_string )
函数:
SELECT MESSAGE_ID, SHORTDESC
FROM VERNACULAR_MASTER
WHERE INSTR( SHORTDESC, CHR(10) )>0
OR INSTR( SHORTDESC, CHR(13) )>0