Subject Re: Queries for 3 or more tables
Author srotyliano
Thanks for the reply Mark.

Using your format I tried...

select * FROM jobs
INNER JOIN INVDETL ON INVDETL.JOBNO = JOBS.JOBNO
INNER JOIN PAYMENT ON PAYTMENT.JOBNO = JOBS.JOBNO

Which gives me a "Not a valid SQL statement". If I remove the last join statement it runs and joins JOBS with INVDETL. So what I'm trying to figure out is how to nest all 3 statements.

BTW - the query is entered in a SQL Builder GUI which is part of a commercial software package (DBA Manufacturing) and not sure if the limitation is in the GUI implementation or a Firebird 1.5 limitation.

Thanks again,

Steve


--- In firebird-support@yahoogroups.com, Mark Rotteveel <mark@...> wrote:
>
> On 31-8-2012 15:33, srotyliano wrote:
> > What is the best way to script a query for combining data from 3 or more tables ?
> >
> > ver: Firebird 1.5
>
> Could you elaborate on what you want to achieve? Normally you would use
> INNER JOIN, LEFT JOIN etc to link up tables with conditions that
> establish which rows should be joined, eg
>
> SELECT <columns>
> FROM table1
> INNER JOIN table2 ON table2.column = table1.column
> INNER JOIN table3 ON table3.column = table2.column
>
> (the last condition could also be table3.column = table1.column)
>
> Mark
>
> --
> Mark Rotteveel
>