help for join

T

Terry

I am attempting to write a sql select statement. The competitor table has
two fields which link to data in two other tables. Fields in the rider
table and fields in the bracket table. First I tried joining one table as
in the following:

SELECT c.cmp_age, c.cmp_brt_id, c.cmp_evt_id, c.cmp_brt_id,
c.cmp_elapsedtime, c.cmp_rdr_id, r.rdr_firstname, r.rdr_id, r.rdr_lastname,
r.rdr_sex

FROM competitor c

INNER JOIN rider r ON (c.cmp_rdr_id = r.rdr_id)

where cmp_evt_id = :eventid

order by cmp_brt_id, cmp_elapsedtime



and this worked fine.

When I added the second table I got errors



SELECT c.cmp_age, c.cmp_brt_id, c.cmp_evt_id, c.cmp_brt_id,
c.cmp_elapsedtime, c.cmp_rdr_id, r.rdr_firstname, r.rdr_id, r.rdr_lastname,
r.rdr_sex, b.brt_id, b.brt_type, b.brt_division

FROM competitor c

INNER JOIN rider r ON (c.cmp_rdr_id = r.rdr_id)

INNER JOIN bracket b ON (c.cmp_brt_id = b.brt_id)

where cmp_evt_id = :eventid and r.rdr_sex = 'M'

order by cmp_brt_id, cmp_elapsedtime



error was - Syntax error (missing operator) in query expression '(cmp_rdr_id
= r.rdr_id) INNER JOIN bracket b ON (c.cmp_brt_id = b.brt_id)'



Any suggestions on how to get this to work?



Thanks
 
V

Van T. Dinh

Is it an JET / Access SQL String?

It doesn't look like it, though. Perhaps, you should post your question /
SQL in the appropriate newsgroups for the required flavour of SQL.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top