Re: joining six tables by mutual column

2005-05-02 Thread Michael Stassen
Schalk Neethling wrote: Mathias/Everyone on the list I am running the following query against the database: SELECT demographic.demographic_no, demographic.first_name, demographic.last_name, demographic.chart_no, demographic.sex, demographic.year_of_birth, demographic.month_of_birth, demographic.

Re: joining six tables by mutual column

2005-05-02 Thread Peter Brawley
Schalk, Your query looks ok except for an apparently missing '%' in LIKE 'TES', but all the WHEREs are hard to read, aren't they? I find queries easier to write, read & maintain with joins in the JOIN clause and specific row-selection criteria in the WHERE clause, eg SELECT demographic.demogra

Re: joining six tables by mutual column

2005-05-02 Thread Schalk Neethling
Mathias/Everyone on the list I am running the following query against the database: SELECT demographic.demographic_no, demographic.first_name, demographic.last_name, demographic.chart_no, demographic.sex, demographic.year_of_birth, demographic.month_of_birth, demographic.date_of_birth, demograph

Re: joining six tables by mutual column

2005-04-25 Thread Nick Pasich
Try this If something is numeric SELECT * FROM table1, table2, table3, table4, table5, table6 WHERE table1.something = table2.something AND table1.something = table3.something AND table1.something = table4.something AND table1.something = table5.something

RE: joining six tables by mutual column

2005-04-25 Thread mathias fatene
Hi, Select * from table1 T1, table2 T2, table3 T3, table4 T4, table5 T5, table6 T6 Where T1.col=T2.col and T2.col=T3.col and T3.col=T4.col and T4.col=T5.col and T5.col=T6.col and T1.col=T6.col [and col='val'] Doesn't this work ? Have you an example ? Best Regards Mathia

Re: joining six tables by mutual column

2005-04-24 Thread Richard Lynch
On Sun, April 24, 2005 3:51 pm, Schalk Neethling said: > Hope someone can give me some pointers here. I have six tables in the > database and I need to JOIN them on a row that appears in all of the > tables. How do I do this? I have so far done the normal 'cross-join' > saying SELECT * FROM table1,