Bertram Scharpf wrote:
> Hi,
> 
> Am Freitag, 27. Jul 2007, 18:35:21 -0000 schrieb pc:
>> I have a table test with columns  col1 col2.col2 contains an entry
>> '\N' .I want to select all entries which have '\N'  in col2.How do i
>> do that?
>>
>> select * from test where col2 like '\N' ;
>> select * from test where col2 like '\\N' ;
> 
>   select * from test where col2 like E'\\\\N';
>   select * from test where col2 =    E'\\N';
> 
> Why use `like' here at all?

Presumably he wanted col2 like E'%\\\\N%'.
But doesn't \N mean NULL, or would the OP be looking for literal '\N'
strings in his data? Because if he's looking for NULLs it may be better
to query for col2 IS NULL.

-- 
Alban Hertroys
[EMAIL PROTECTED]

magproductions b.v.

T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
   7500 AK Enschede

// Integrate Your World //

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

Reply via email to