Re: Left Join with Limit 1

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Alex Magnum <magnum11200(at)gmail(dot)com>, Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Left Join with Limit 1
Date: 2015-10-12 15:13:55
Message-ID: 561BCE33.6090308@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/12/15 10:03 AM, Alex Magnum wrote:
> Is there a way to use a limit in the join?

SELECT ... FROM table_a a
LEFT JOIN ( SELECT ... FROM table_b WHERE ... LIMIT 1) b
ON a.blah = b.blah
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jim Nasby 2015-10-12 15:14:36 Re: BDR workers exiting?
Previous Message Paul Jungwirth 2015-10-12 15:12:58 Re: Left Join with Limit 1