pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: nickf@ontko.com
To: PGSQL-SQL <pgsql-sql@postgresql.org>
Subject: Re: RIGHT JOIN is only supported with mergejoinable join
Date: Wed, 07 Nov 2001 08:49:10 -0800
Message-ID: <web-500809@davinci.ethosmedia.com> (raw)
In-Reply-To: <NEBBLAAHGLEEPCGOBHDGGEDJDOAA.nickf@ontko.com>

Nick,

> RIGHT JOIN is only supported with mergejoinable join conditions

Woof!  Talk about destruction testing.  You have ... let's see ... a
three-column right join on two right-joined tables.  If you ahve
uncovered a bug, I wouldn't be surprised.  

However, are you sure you want RIGHT OUTER JOINS and not LEFT?  Try
re-organizing the query as LEFT JOINS, and see if it works.  

create view demo as
      select
        case_data.case_id,
        case_disposition_code.case_disp_global_desc,
        local_case_type.global_case_type_desc
      from
        ( case_data
          left join
          case_disposition_code
          on
          case_data.case_disp_local_code =
          case_disposition_code.case_disp_local_code 
        )
        LEFT JOIN local_case_type ON
        ((
          local_case_type.court_id =
          case_data.court_id
        )
        and
        (
          local_case_type.local_case_subtype_code =
          case_data.local_case_type_code
        )
        and
        (
          local_case_type.local_case_subtype_code =
          case_data.local_case_subtype_code
        ));

If that doesn't work, try making the case_data and case_disposition_code
join into a subselect.

-Josh 

______AGLIO DATABASE SOLUTIONS___________________________
                                       Josh Berkus
  Complete information technology      josh@agliodbs.com
   and data management solutions       (415) 565-7293
  for law firms, small businesses        fax 621-2533
    and non-profit organizations.      San Francisco



view thread (8+ messages)  latest in thread

Message-ID: <web-500809@davinci.ethosmedia.com>
Permalink:  ../web-500809@davinci.ethosmedia.com/
Also on:    postgresql.org/message-id/web-500809@davinci.ethosmedia.com

 · 

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: josh@agliodbs.com, nickf@ontko.com
  Subject: Re: RIGHT JOIN is only supported with mergejoinable join
  In-Reply-To: <web-500809@davinci.ethosmedia.com>

* 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