Re: query to match '\N'
От | Alban Hertroys |
---|---|
Тема | Re: query to match '\N' |
Дата | |
Msg-id | 46ADB0A9.9020601@magproductions.nl обсуждение исходный текст |
Ответ на | Re: query to match '\N' (Bertram Scharpf <lists@bertram-scharpf.de>) |
Ответы |
Re: query to match '\N'
|
Список | pgsql-general |
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 alban@magproductions.nl 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 //
В списке pgsql-general по дате отправления: