I have a table that needs to be cleared with one of the fields. The basic structure of the table is as follows:
create table testComments(id int, comments text)
In the comments column, on some lines there were many “carriage returns” (char (13)) and “line feed” (char (10)). If there is more than one group in each line, I need to modify it. The main select statement I have is the following:
select count(id) from testComments where comments like('%' + char(13) + char(10) + char(13) + char(10) + '%')
Results will be found in this query.
"This is a entry in the testComments crlf crlf In the comments field that works"
Although the query will not find results if the comment is listed below:
"This is an entry in the testComments crlf crlf crlf That will not work"
The query will only return the number of records from 1 for the above data. Any idea how I can modify the request to return invoice 2?
Chris source share