pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: msi77 <msi77@yandex.ru>
To: Wes James <comptekki@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Re: how to do this query
Date: Sat, 09 Jan 2010 14:36:34 +0300
Message-ID: <8071263036994@webmail102.yandex.ru> (raw)
In-Reply-To: <533df7fa1001082026h53b5d897x2fc1fa2a6f7ff6df@mail.gmail.com>
References: <533df7fa1001082026h53b5d897x2fc1fa2a6f7ff6df@mail.gmail.com>

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



view thread (9+ messages)  latest in thread

Message-ID: <8071263036994@webmail102.yandex.ru>
Permalink:  ../8071263036994@webmail102.yandex.ru/
Also on:    postgresql.org/message-id/8071263036994@webmail102.yandex.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: msi77@yandex.ru, comptekki@gmail.com
  Subject: Re: how to do this query
  In-Reply-To: <8071263036994@webmail102.yandex.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox