Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 4DAA663259B for ; Sat, 9 Jan 2010 07:36:49 -0400 (AST) 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 13744-03 for ; Sat, 9 Jan 2010 11:36:38 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from forward14.mail.yandex.net (forward14.mail.yandex.net [95.108.130.92]) by mail.postgresql.org (Postfix) with ESMTP id C4C7B63235F for ; Sat, 9 Jan 2010 07:36:38 -0400 (AST) Received: from webmail102.yandex.ru (webmail102.yandex.ru [95.108.130.6]) by forward14.mail.yandex.net (Yandex) with ESMTP id A402126801DC; Sat, 9 Jan 2010 14:36:35 +0300 (MSK) Received: from localhost (localhost.localdomain [127.0.0.1]) by webmail102.yandex.ru (Yandex) with ESMTP id 72322A14002; Sat, 9 Jan 2010 14:36:35 +0300 (MSK) X-Yandex-Spam: 1 X-Yandex-Front: webmail102 X-Yandex-TimeMark: 1263036995 Received: from user-18.81.118.217.in-addr.arpa (user-18.81.118.217.in-addr.arpa [217.118.81.18]) by mail.yandex.ru with HTTP; Sat, 09 Jan 2010 14:36:34 +0300 From: msi77 To: Wes James ,pgsql-sql@postgresql.org In-Reply-To: <533df7fa1001082026h53b5d897x2fc1fa2a6f7ff6df@mail.gmail.com> References: <533df7fa1001082026h53b5d897x2fc1fa2a6f7ff6df@mail.gmail.com> Subject: Re: how to do this query MIME-Version: 1.0 Message-Id: <8071263036994@webmail102.yandex.ru> Date: Sat, 09 Jan 2010 14:36:34 +0300 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=koi8-r X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=3.003 tagged_above=-10 required=5 tests=BAYES_40=-0.185, FH_DATE_PAST_20XX=3.188 X-Spam-Level: *** X-Archive-Number: 201001/13 X-Sequence-Number: 33549 How about schols_selected like '%' || short_name || '%' > I have two tables: > students > stu_name > schols_selected > scholarships > schol_name > short_name > schols_selected is made up of scholarships the students have selected, > the field content will look like schol1:schol2:schol3 > I need a select that does something like this > select schol_name, short_name, stu_name, schols_selected > from scholarships, students > where short_name is in schols_selected > I have tried: > where short_name like '%' || schols_selected || '%' > but i'm not sure how to include a field result in between like operators. > how do I get a list of scholarships based one which student selected > it where the selected result is a string of colon seperated options? > thx, > -wj > -- > Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-sql > Здесь спама нет http://mail.yandex.ru/nospam/sign