ivanovn
asked on
Text field comparison involving new line characters
I have a text field that stores a chunk of text that contains some new lines as well. I am unable to do a succesful comparison of that field with provided string.
For example I have the following situation:
CREATE TABLE table1
(
id int4 NOT NULL,
message text,
);
In that table there is a record where:
id=1
message=SPECIAL WEATHER STATEMENT
NATIONAL WEATHER SERVICE BLACKSBURG VA
436 AM EDT FRI APR 14 2006
NCZ001>006-018>020-VAZ007- 009>020-02 2>024-032> 035-043>04 7-058-059-
WVZ042>045-141600
I want to find all the ids that have that particular message. So I execute the following query:
SELECT id FROM table1 WHERE message = 'SPECIAL WEATHER STATEMENT
NATIONAL WEATHER SERVICE BLACKSBURG VA
436 AM EDT FRI APR 14 2006
NCZ001>006-018>020-VAZ007- 009>020-02 2>024-032> 035-043>04 7-058-059-
WVZ042>045-141600'
However this returns no records. Why is this the case, and how should I compare this message to get a match on the id?
Thanks.
For example I have the following situation:
CREATE TABLE table1
(
id int4 NOT NULL,
message text,
);
In that table there is a record where:
id=1
message=SPECIAL WEATHER STATEMENT
NATIONAL WEATHER SERVICE BLACKSBURG VA
436 AM EDT FRI APR 14 2006
NCZ001>006-018>020-VAZ007-
WVZ042>045-141600
I want to find all the ids that have that particular message. So I execute the following query:
SELECT id FROM table1 WHERE message = 'SPECIAL WEATHER STATEMENT
NATIONAL WEATHER SERVICE BLACKSBURG VA
436 AM EDT FRI APR 14 2006
NCZ001>006-018>020-VAZ007-
WVZ042>045-141600'
However this returns no records. Why is this the case, and how should I compare this message to get a match on the id?
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.