X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id F0B85D1B1C9 for ; Sun, 25 Jul 2004 10:20:25 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 63892-08 for ; Sun, 25 Jul 2004 13:20:30 +0000 (GMT) Received: from smtpin.eastlink.ca (smtpin.eastlink.ca [24.222.0.18]) by svr1.postgresql.org (Postfix) with ESMTP id EDC5ED1B18C for ; Sun, 25 Jul 2004 10:20:19 -0300 (ADT) Received: from Keith ([24.224.224.198]) by mx3.eastlink.ca (iPlanet Messaging Server 5.2 HotFix 1.21 (built Sep 8 2003)) with SMTP id <0I1E00L9CSV4JI@mx3.eastlink.ca> for pgsql-sql@postgresql.org; Sun, 25 Jul 2004 10:16:18 -0300 (ADT) Date: Sun, 25 Jul 2004 10:18:17 -0300 From: Keith Gallant Subject: SELECT from a list To: pgsql-sql@postgresql.org Message-id: MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7BIT Importance: Normal X-Priority: 3 (Normal) X-MSMail-priority: Normal X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.4 tagged_above=0.0 required=5.0 tests=RCVD_IN_SORBS, UPPERCASE_25_50 X-Spam-Level: X-Archive-Number: 200407/214 X-Sequence-Number: 18466 Hello I am wondering if it is possible to use a SINGLE LIKE statement for a selection from a list. For example: If I want to return all results that a phrase starts with a number, can I make a call similar to the following: SELECT * FROM table WHERE phrase LIKE {'0%','1%','2%','3%','4%','5%','6%','7%','8%','9%'}; If not is there an easier way than having to call this: SELECT * FROM table WHERE phrase LIKE '0%' OR phrase LIKE '1%' OR phrase LIKE '2%' OR phrase LIKE '3%' OR phrase LIKE '4%' OR phrase LIKE '5%' OR phrase LIKE '6%' OR phrase LIKE '7%' OR phrase LIKE '8%' OR phrase LIKE '9%'; Thank you. Keith