Home > Archive > MySQL Java > August 2005 > JOIN question









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author JOIN question
Schalk

2005-08-31, 1:23 pm

Greetings All

I have two tables, ab.comp_results and ab.competitions. I want to
execute a select query and JOIN these two tables. This is easy enough
but, here is my problem.

QUERY:
SELECT CR.pos, CR.member_name, CR.comp_img, CR.competition, C.town,
C.comp_name, C.comp_date FROM ab_comp_results CR, ab_competitions C " +
"WHERE cup = '" + request.getParameter("cup") + "' AND CR.competition =
'" + request.getParameter("comp") + "' AND sex = 'Female'";

Seeing that CR.competition has to first match the requestParameter, how
do I go about JOINing these two tables ON CR.competition and C.comp_name
based on the value of request.getParameter("comp")? The reason I want to
JOIN these two tables is so that I do not have to duplicate the town and
comp_date values inside of the ab.comp_results table.

Any help, ideas or pointers are welcome. Thanks!

--
Kind Regards
Schalk Neethling
Web Developer.Designer.Programmer.President
Volume4.Business.Solution.Developers



--
MySQL Java Mailing List
For list archives: http://lists.mysql.com/java
To unsubscribe: http://lists.mysql.com/java?unsub=m...sie.nctu.edu.tw

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com