Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 65F2A6336EB for ; Sat, 9 Jan 2010 00:26:24 -0400 (AST) 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 87497-06 for ; Sat, 9 Jan 2010 04:26:13 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-px0-f186.google.com (mail-px0-f186.google.com [209.85.216.186]) by mail.postgresql.org (Postfix) with ESMTP id 3AAFF632AC3 for ; Sat, 9 Jan 2010 00:26:13 -0400 (AST) Received: by pxi16 with SMTP id 16so5518166pxi.29 for ; Fri, 08 Jan 2010 20:26:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=4hJvk5RgsG6TuTrDgbtspSS7bq1vJSckgXzoYd6ny0o=; b=vdE9o/I601zqsRVVLf9IgGSHh8BBWwOGdUKvoq9T2tATeGEjpqxSa79FoJlSIl3cVI EE5MACHTwOxij3i3rJ54i8O6yjLbzPexqLDrsO3z70/qTb7jZUES6IbIqLILAqlbg3Oi tLkmsQ5R9BD6ZrPv0Jqd5S/eT6m4lbgy6onmU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Lz3l0LG+XMuvtDlmkeBhIS3YJRsPvlHJ9q3PujqVEUp8mB2p0Oqm1hOmL4FeymiqfZ g6u5cuOXtxxGpAdq48hw9LI1mdAsRn9oan/YnDMw6u2hfC1EVNz5jVX9pJAVoC8P2vmb FS89aiS9BwNo3m7t4SxGOJJCxBMLgMIiMeKYo= MIME-Version: 1.0 Received: by 10.140.83.37 with SMTP id g37mr5282465rvb.95.1263011171484; Fri, 08 Jan 2010 20:26:11 -0800 (PST) Date: Fri, 8 Jan 2010 21:26:11 -0700 Message-ID: <533df7fa1001082026h53b5d897x2fc1fa2a6f7ff6df@mail.gmail.com> Subject: how to do this query From: Wes James To: pgsql-sql@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 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: 201001/11 X-Sequence-Number: 33547 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