Re: Can't get my query right!!
Date: 1997/08/08
Message-ID: <5sfeqq$7vp_at_news-1.boco.co.gov>#1/1
<HTML>
Chris,
<P>I don't think this meets the intent of the query. David wanted
to match each name with <U>one</U> of its addresses, while this will match
each name with <U>all</U> of its addresses.
<P>chris wrote:
<BLOCKQUOTE TYPE=CITE> Try this:
<P>SELECT NAME.NAME, NAME.KEY, ADDRESS.ADDRESS
<BR>FROM NAME, ADDRESS
<BR>WHERE NAME.KEY = ADDRESS.KEY;
<P>good luck.
<P>Christopher Suh</BLOCKQUOTE>
I think this would be the simplist way to write it. MIN could be
replaced by some other group function, built-in or created, depending on
which address you wish to select.
<P>SELECT DISTINCT NAME.NAME, NAME.KEY, MIN(ADDRESS.ADDRESS)
<BR>FROM
NAME, ADDRESSWHERE
NAME.KEY = ADDRESS.KEY;
<P>enjoy.
<BR>-Ian</HTML>
Received on Fri Aug 08 1997 - 00:00:00 CEST