Re: [GENERAL] Question About UNION

2008-10-09 Thread David Wilson
On Thu, Oct 9, 2008 at 3:31 PM, Bill Thoen <[EMAIL PROTECTED]> wrote: > Thanks, but that didn't work. That selected only the records from table1. That's why I warned you about it being written in gmail. :) select * from table1 union select table2.* from table2 left join table1 on table2.a=table1

Re: [GENERAL] Question About UNION

2008-10-09 Thread Bill Thoen
Josh Williams wrote: On Thu, 2008-10-09 at 10:59 -0600, Bill Thoen wrote: I'm trying to combine two tables, but I only want unique records based on the first two columns. Can UNION be used to join three-column tables but only include records based on the uniqueness of the first two columns? I

Re: [GENERAL] Question About UNION

2008-10-09 Thread Bill Thoen
David Wilson wrote: On Thu, Oct 9, 2008 at 3:31 PM, Bill Thoen <[EMAIL PROTECTED]> wrote: Thanks, but that didn't work. That selected only the records from table1. That's why I warned you about it being written in gmail. :) I'm sorry, you had it right the first time. Here's a scrip

Re: [GENERAL] Question About UNION

2008-10-09 Thread Bill Thoen
David Wilson wrote: On Thu, Oct 9, 2008 at 1:48 PM, Bill Thoen <[EMAIL PROTECTED]> wrote: No, this won't work. Here's an example of my tables: Table1 1, 12, A 2, 16, B 8, 6, A 19, 9, C Table2 1, 13, D 2, 16, B 8, 6, B 12, 5, A select * from table1 union select table2.* from table2 lef

Re: [GENERAL] Question About UNION

2008-10-09 Thread Josh Williams
On Thu, 2008-10-09 at 10:59 -0600, Bill Thoen wrote: > >> I'm trying to combine two tables, but I only want unique records based > >> on the first two columns. Can UNION be used to join three-column tables > >> but only include records based on the uniqueness of the first two > >> columns? If not,

Re: [GENERAL] Question About UNION

2008-10-09 Thread David Wilson
On Thu, Oct 9, 2008 at 1:48 PM, Bill Thoen <[EMAIL PROTECTED]> wrote: > No, this won't work. Here's an example of my tables: > Table1 > 1, 12, A > 2, 16, B > 8, 6, A > 19, 9, C > > Table2 > 1, 13, D > 2, 16, B > 8, 6, B > 12, 5, A select * from table1 union select table2.* from table2 left join ta

Re: [GENERAL] Question About UNION

2008-10-09 Thread Bill Thoen
Raymond O'Donnell wrote: On 09/10/2008 17:59, Bill Thoen wrote: I'm trying to combine two tables, but I only want unique records based on the first two columns. Can UNION be used to join three-column tables but only include records based on the uniqueness of the first two columns? If not, how

Re: [GENERAL] Question About UNION

2008-10-09 Thread Bill Thoen
Raymond O'Donnell wrote: On 09/10/2008 17:59, Bill Thoen wrote: I'm trying to combine two tables, but I only want unique records based on the first two columns. Can UNION be used to join three-column tables but only include records based on the uniqueness of the first two columns? If not, how

Re: [GENERAL] Question About UNION

2008-10-09 Thread Raymond O'Donnell
On 09/10/2008 17:59, Bill Thoen wrote: >>> I'm trying to combine two tables, but I only want unique records based >>> on the first two columns. Can UNION be used to join three-column tables >>> but only include records based on the uniqueness of the first two >>> columns? If not, how would I do thi

Re: [GENERAL] Question About UNION

2008-10-09 Thread Bill Thoen
Raymond O'Donnell wrote: On 09/10/2008 17:36, Bill Thoen wrote: I'm trying to combine two tables, but I only want unique records based on the first two columns. Can UNION be used to join three-column tables but only include records based on the uniqueness of the first two columns? If not, how

Re: [GENERAL] Question About UNION

2008-10-09 Thread Raymond O'Donnell
On 09/10/2008 17:36, Bill Thoen wrote: > I'm trying to combine two tables, but I only want unique records based > on the first two columns. Can UNION be used to join three-column tables > but only include records based on the uniqueness of the first two > columns? If not, how would I do this with P

[GENERAL] Question About UNION

2008-10-09 Thread Bill Thoen
I'm trying to combine two tables, but I only want unique records based on the first two columns. Can UNION be used to join three-column tables but only include records based on the uniqueness of the first two columns? If not, how would I do this with PostgreSQL 8.1? -- Sent via pgsql-general