Re: [SQL] Wrong output from union

2012-03-30 Thread David Johnston
Documented behavior. Please read the section on UNION for the why and the proper alternative syntax: http://www.postgresql.org/docs/9.0/interactive/sql-select.html On Mar 28, 2012, at 7:01, Gary Stainburn wrote: > Hi folks. > > I have two selects which in themselves report what they should.

[SQL] Wrong output from union

2012-03-30 Thread Gary Stainburn
Hi folks. I have two selects which in themselves report what they should. However, when I run a union to combine their outputs (to then feed a select/count) lines disappear. Below are the two seperate selects, followed by the untion in which duplicate rows are lost. I'm using Postgresql 8.3.3-