Re: Easiest way to extract owner-id from a third table

From: Rikard Bosnjakovic <rikard(dot)bosnjakovic(at)gmail(dot)com>
To: Thom Brown <thom(at)linux(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Easiest way to extract owner-id from a third table
Date: 2010-08-20 16:05:49
Message-ID: AANLkTikrRbABxiT9+fCzfVjT0aG1VSqA6nezMqRkZeJt@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Thu, Aug 19, 2010 at 19:46, Thom Brown <thom(at)linux(dot)com> wrote:

> Try this:
>
> SELECT components.owner_id
> FROM components
> INNER JOIN component_images ON components.id = component_images.components_id
> WHERE component_images.images_id = %
> LIMIT 1

Magic!

Thank you.

--
- Rikard

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Chip Steele 2010-08-20 20:15:32 Streaming Replication in PostgreSQL9.0 b4: Standby dropping connections
Previous Message Mladen Gogala 2010-08-19 18:23:26 Re: Queries running the longest?