I would like to find all records where a certain field ends with a newline. Here’s what I’ve tried so far:
SELECT * FROM foo WHERE bar LIKE '%' + CHAR(10);
SELECT * FROM foo WHERE bar LIKE U&'%\000A';
SELECT * FROM foo WHERE bar LIKE '%\000A';
SELECT * FROM foo WHERE bar LIKE '%\0A';
The first two are rejected as syntax errors. The second two run but return zero records (despite there being records with trailing newlines), which leads me to the conclusion that what I intended to be a newline is not understood as such.
What is the correct way to specify a newline in a LIKE expression?