Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 4CC27633711 for ; Fri, 4 Sep 2009 21:45:21 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 67242-06 for ; Sat, 5 Sep 2009 00:45:13 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from web53905.mail.re2.yahoo.com (web53905.mail.re2.yahoo.com [206.190.36.215]) by mail.postgresql.org (Postfix) with SMTP id 91B4D63361B for ; Fri, 4 Sep 2009 21:45:13 -0300 (ADT) Received: (qmail 32573 invoked by uid 60001); 5 Sep 2009 00:45:11 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1252111511; bh=HfyDHe59jnHWmdXStfrb7DRG27XODqR4oPgy+PsDnYQ=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=xlzvLvLKBopxifBx0RrsTruJgycsA8N3Q1DwA+3kYc4hEVw92FOetE5wBPzkBfogk+CajCve6KwLgslzFgPA3u/b/WxoeheJYmIlkPh+2T/Q+EDkJdfy5k9Lc5k6gis4YoU6JHM+s/Bm92dOc2mW6dgNA2ekU2z6oSnADpo/X28= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=OiTQ6k8e3V2p/VlbNlTuFeT384cJg2YFJfhCm/cEQgUierub6+TB8dxhCj3SQEXnkbGFp0T3wSi5teqD7HB+q2s2qUVsflZDCk4aExDSzdWmFf8LT1ulYjKQq6KR+20kTpi/+Ysy135XmyFCNMp+rjdpNVWgUC6/mjFg9Im+APk=; Message-ID: <15318.85292.qm@web53905.mail.re2.yahoo.com> X-YMail-OSG: d2gRK6sVM1nmeXcVEpPhG7l6J6h2Y7V.RYqThrZ.woQAiaZLmAhonYPLAY_Xaj3wvY__jtfT.FOIro_xApfl9IQHeGEJrQapqWNbtqORAysFigYIUc0vO1Xbx871HV6BRF6_aNquvH82TPK2Nqq1JcMbrW4JORqMoMD2czvf3K5M_rs5ej34zw_3sneR4oj15OYgQuIXrQYlCgYTKE9MuiFusB.DJ86J9M96zpHtVXbddb3.CUJrLn2QYyFRdKxB3N_AHQIgHWDR4vNKOx13EF63EVGck.y0Yl050q5wxoscJ2LT0dDPG4tfdjR1D2VtbSKf5se1DoVY2KAcOnKV4K2ZIV0CkzdHMz0S Received: from [62.150.150.85] by web53905.mail.re2.yahoo.com via HTTP; Fri, 04 Sep 2009 17:45:10 PDT X-Mailer: YahooMailClassic/6.1.2 YahooMailWebService/0.7.338.2 Date: Fri, 4 Sep 2009 17:45:10 -0700 (PDT) From: bilal ghayyad Subject: Substring To: pgsql-sql@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.11 tagged_above=-10 required=5 tests=BAYES_05=-1.11 X-Spam-Level: X-Archive-Number: 200909/25 X-Sequence-Number: 33090 Hello; I have an sql script function that take one text parameter "funct (text)", what I need to do is the following: If the parameter name is string and its value was for example "abcd" then I need to do a query based on ab and then based on the abc, how? Example: SELECT * from voipdb where prefix like string But I need the string to be ab and then to be abc? How I can assign the string to the first character and then to the first and second? In other words, how can I can take part of the string to do query on it? Regards Bilal