[thelist] Sql query troubles

fstorr fffrancis at fstorr.demon.co.uk
Tue Aug 12 13:12:14 CDT 2003


Hi all

I've spent too much time on this today, and I'm grey enough already...

I've got a database with 2 tables in.  The first one contains an index
(auto incrementing) column, a term column and a check to see if the term
is an acronym/abbrieviation.  The second table contains a list of
definitions for the terms.  Eaverything works well until I get to a term
that has two definitions in.  What I want to pull out of the query is
one term and two definitions and not the same term listed twice, once
for each defintion.  For the life of me, I can't work out how to do
this.  Defintion.term (below) is a foreign key back to the term table so
that multiple definitions can be linked to the same term.

This is what I've got:

"SELECT term.term as mainterm, term.acronym, definition.longform,
definition.description, definition.href1, definition.linktext1 FROM
term, definition WHERE definition.term = term.index AND term.term
LIKE '%$jargsearch%'";

Help!

Regards

Francis




More information about the thelist mailing list