Search Postgresql Archives

Re: ERROR: FULL JOIN is only supported with merge-joinable join conditions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Harco de Hilster (harcoh@xxxxxxxxxxxxxxxx) wrote:
> ERROR:  FULL JOIN is only supported with merge-joinable join conditions

I'm not a big fan of that error either, honestly.

> select *
> from A
> full outer join B on A.f1 = B.f1  and  ((A.ExpTime IS NULL AND B.ExpTime 
> IS NULL) OR (A.ModTime <= B.ExpTime AND (B.ExpTime > A.ExpTime OR 
> B.ExpTime IS NULL)))

What about:

inner join
union all
left join
union all
right join

?  You'd need to add a couple where clauses to make the left/right joins
only return rows not returned by the inner join.  Honestly, that setup
is pretty ugly though and you might consider trying to figure out a way
to clean it up.

It'd be nice if Postgres would basically just do this for you. :/
Perhaps one of the other folks can explain why it doesn't just work.

	Enjoy,

		Stephen

Attachment: signature.asc
Description: Digital signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux