Re: [GENERAL] Querying same lookup table with multiple columns based on another view

2015-11-17 Thread Jim Nasby
On 11/17/15 9:21 AM, Melvin Davidson wrote: Your problem is the use of SELECT * I've often wished for a way to do *, but make changes to the results that a normal * would give you. The two operations I've wished for are to either remove some fields from the list, or to rename some fields.

Re: [GENERAL] Querying same lookup table with multiple columns based on another view

2015-11-17 Thread Raymond O'Donnell
On 17/11/2015 15:33, Killian Driscoll wrote: > > In terms of database structure and typing efficiency, it might be better > to restructure the lookup tables and create a new lookup table for each > of the three columns instead of one combined one? [Please keep you replies on-list - thanks!]

Re: [GENERAL] Querying same lookup table with multiple columns based on another view

2015-11-17 Thread Raymond O'Donnell
On 17/11/2015 16:07, Killian Driscoll wrote: > > > > > In terms of database structure and typing efficiency, it might be better > > to restructure the lookup tables and create a new lookup table for each > > of the three columns instead of one combined one? > > [Please keep

Re: [GENERAL] Querying same lookup table with multiple columns based on another view

2015-11-17 Thread Killian Driscoll
> > > > In terms of database structure and typing efficiency, it might be better > > to restructure the lookup tables and create a new lookup table for each > > of the three columns instead of one combined one? > > [Please keep you replies on-list - thanks!] > Sorry! Didn't mean that > >

[GENERAL] Querying same lookup table with multiple columns based on another view

2015-11-17 Thread Killian Driscoll
I have a view with 15 columns and want to create another view based on a join with another table with 15 columns that includes three columns that reference one lookup table. If I use the the below sql I get the error "column "macro_lookup_id" specified more than once". I have read that I can

Re: [GENERAL] Querying same lookup table with multiple columns based on another view

2015-11-17 Thread Melvin Davidson
Your problem is the use of SELECT * You need to be specific about which columns you are selecting from macro_lookup and what names you want to give them. Since you have not provided us with the full structure, I can only suggest something like CREATE OR REPLACE VIEW sample_macro AS SELECT

Re: [GENERAL] Querying same lookup table with multiple columns based on another view

2015-11-17 Thread Killian Driscoll
On 17 November 2015 at 16:10, Killian Driscoll wrote: > I have a view with 15 columns and want to create another view based on a > join with another table with 15 columns that includes three columns that > reference one lookup table. > > If I use the the below sql I

Re: [GENERAL] Querying same lookup table with multiple columns based on another view

2015-11-17 Thread Raymond O'Donnell
On 17/11/2015 15:10, Killian Driscoll wrote: > I have a view with 15 columns and want to create another view based on a > join with another table with 15 columns that includes three columns that > reference one lookup table. > > If I use the the below sql I get the error "column "macro_lookup_id"