In Oracle, what is SQL querying for rows to appear?

I need to find rows in which a specific column contains a row.

This does not work: select * from [table], where [column], for example '% \ n%'

In SO, I found a solution for SQL Server: New line in Sql query

But this does not work in Oracle. Is there an ANSI SQL solution? This should be standard ...

If not, what is the solution in Oracle?

+3
source share
5 answers

An alternative to InStr (), which expresses SQL a bit more in line with this problem. IMHO.

select * from [table] where [column] like '%'||chr(10)||'%'
+3
source

you can find the character CHR (10) (character for a new line):

select * from [table] where instr(column, chr(10)) > 0
+3
source

Oracle 10g ,

select * from [table] where regexp_like([column], '\n')
+1

* tableNameHere instr (colNameHere, chr (10)) > 0

0
source

As an alternative:

SELECT * FROM [table] WHERE column LIKE "%\n%"

\ n - string, \ r - carriage return ...

-1
source

Source: https://habr.com/ru/post/1719986/


All Articles