Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 268EB632ECC for ; Mon, 27 Apr 2009 01:54:22 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 84646-02 for ; Mon, 27 Apr 2009 01:54:17 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ew0-f215.google.com (mail-ew0-f215.google.com [209.85.219.215]) by mail.postgresql.org (Postfix) with ESMTP id 93996632B67 for ; Mon, 27 Apr 2009 01:54:18 -0300 (ADT) Received: by ewy11 with SMTP id 11so1980904ewy.19 for ; Sun, 26 Apr 2009 21:54:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=ROhgdMLgQLGagZ3xiT9HfwiDeKGAPD+8InCiiMm1cw8=; b=xmpIEurLhbjB0Bn71PwmjLrLTrzoazBDg6cardzVcvJy5U7Nw3MoEZVoqbdAcR5AfE GZk3Sn55XyLBZIf3XLv2oGWxe2P1QVWDfq4mbA4DG6gLE9lTwKXf0G+s+46EeIWS7+xd 0c5knrwA2YjOTJ4iGqUawPO4ve28/8ZVobdFg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=xI+kXeHNb8YM6YpAe6WtAaVqQxR1VvXUsrUNlpieH2J/4IrWlHUazwjpTMr1UL54aA DW0CKVjN6SNq6lS+I4ZpDGrNyS0OwkOU5zvF5i+ngqHR7GY8H8nERk1trCRecD1Voc4q tMuaF+Z3rO1lmashWad/Yll6EJ+Hx618lIKNc= MIME-Version: 1.0 Received: by 10.210.113.19 with SMTP id l19mr4275308ebc.56.1240808057333; Sun, 26 Apr 2009 21:54:17 -0700 (PDT) In-Reply-To: <23248274.post@talk.nabble.com> References: <23248274.post@talk.nabble.com> Date: Sun, 26 Apr 2009 22:54:17 -0600 Message-ID: Subject: Re: Query with Parameters and Wildcards From: Scott Marlowe To: landsharkdaddy Cc: pgsql-sql@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.002 tagged_above=0 required=5 tests=AWL=0.002 X-Spam-Level: X-Archive-Number: 200904/119 X-Sequence-Number: 32465 On Sun, Apr 26, 2009 at 6:21 PM, landsharkdaddy wrote: > > I have a query that works on SQL Server to return customers that contain the > string entered by the user by accepting parameters and using the LIKE > keyword. I would like to move this to postgreSQL but I'm just not sure how > to get it done. This is the query > > SELECT * FROM Customers WHERE FirstName LIKE @custfirst + '%'; > > This works great on SQL Server but not on postgreSQL. Any help would be > appreciated. Have you tried: SELECT * FROM Customers WHERE FirstName LIKE 'custfirst%'; What does the @ do in sql server?