Subject | Re: problem with left outer join |
---|---|
Author | Adam |
Post date | 2006-08-08T05:57Z |
--- In firebird-support@yahoogroups.com, "Gary T. Benner" <gary@...>
wrote:
record in the joined tables.
tables.
don't force the join order. Maybe it is getting mixed up with the
mixing of SQL 89 and 92?
Try
select *
from winetaste wt
join wine w on (wt.wineid = w.vintageid)
left join person p on (p.personid = wt.tasterid)
left join region r on (r.regionid = w.regionid)
left join country c on (c.countryid = r.countryid)
left join winery y on (y.wineryid = w.wineryid)
where wt.tasteid = 179008
btw:
join = inner join
left join = left outer join
Adam
wrote:
>I use to retrieve data from tables where there may or may not be a
> Hi all,
>
> I'd like some input on an issue with using left outer join's which
record in the joined tables.
>operation".
> This is our query:
>
> select *
> from winetaste wt, wine w
> left outer join person p on p.personid = wt.tasterid
> left outer join region r on r.regionid = w.regionid
> left outer join country c on c.countryid = r.countryid
> left outer join winery y on y.wineryid = w.wineryid
> where wt.wineid = w.vintageid
> and wt.tasteid = 179008
>
> It fails with the error message "no current record for fetch
>yet I want to return as much data as is available from the other
> The data is such that a "wine" record may not include region data,
tables.
>That is the error you get if you use a stored procedure in a join and
> BTW you can tell what we drink here <g>.
>
> kind regards
>
> Gary
don't force the join order. Maybe it is getting mixed up with the
mixing of SQL 89 and 92?
Try
select *
from winetaste wt
join wine w on (wt.wineid = w.vintageid)
left join person p on (p.personid = wt.tasterid)
left join region r on (r.regionid = w.regionid)
left join country c on (c.countryid = r.countryid)
left join winery y on (y.wineryid = w.wineryid)
where wt.tasteid = 179008
btw:
join = inner join
left join = left outer join
Adam