Received: from crazypenguins.commandprompt.com (commandprompt.com [64.81.28.146]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f2TGQ4K44326; Thu, 29 Mar 2001 11:26:05 -0500 (EST) (envelope-from pma@commandprompt.com) Received: from commandprompt.com (gw [64.81.28.144]) by crazypenguins.commandprompt.com (8.9.3/8.9.3) with ESMTP id IAA20700; Thu, 29 Mar 2001 08:17:45 -0800 Message-ID: <3AC2F17A.BFC50830@commandprompt.com> Date: Thu, 29 Mar 2001 08:25:30 +0000 From: Phuong Ma Organization: Command Prompt, Inc. X-Mailer: Mozilla 4.72 [en] (X11; U; Linux 2.2.16-3 i586) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-general@postgresql.org, pgsql-sql@postgresql.org Subject: inconsistent functionality with LIKE operator X-Priority: 2 (High) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200103/1360 X-Sequence-Number: 6925 I'm using PostgreSQL version 7.1, and I'm having trouble with the LIKE statement. How would I find the value "a\bc"? I tried using the backslash to escape it: LIKE 'a\\b%'; If I specify: LIKE 'a\\bc', then it works, but if I wanted it to look for consecetive characters after the c, using the %, then it returns other values besides what I'm looking for. I also have the same problem with percent (%). I have a test string with the value "ab%c", and I want to look for that using LIKE. I tried: LIKE 'ab\%c', LIKE 'ab%%', and LIKE 'ab\%_', but these statements not only returned what I was looking for, but also other values: "abc","ABC", and "Abc". Phuong