Try using SELECT DISTINCT ID, ... or SELECT DISTINCTROW ID, ...

The reason is probably because you're joining fields from two tables,
causing repetitions in the second one.

Si.


Sponsors of the 1st Northern Information Security Conference
http://www.nisc.org.uk

Sapphire Technologies Ltd.
Secure in the Knowledge
Simon Halcrow   Web Developer   
E  [EMAIL PROTECTED]           
T +44 (0)1642 702100            
F  +44 (0)1642 702119


> -----Original Message-----
> From: W Luke [SMTP:[EMAIL PROTECTED]]
> Sent: 18 September 2000 09:50
> To:   [EMAIL PROTECTED]
> Subject:      Query Problem
> 
> [I did post this last night, but my mail server didn't deliver it.  So
> here
> it is again]
> 
> Hi,
> 
> I'm probably being stupid here but can someone please help me on my query?
> It's displaying the correct results - but more than once:
> 
> <cfquery name="cats" datasource="localads">
> 
>  SELECT ID, cat_name, sub_name, sub_id, catid
>  FROM categories, sub_categories
>  WHERE sub_categories.catid = #url.cid#
> 
> </cfquery>
> <Cfoutput>#cats.cat_name# - Sub Cats:</cfoutput>
> <Cfoutput query="cats">#sub_name#<br></cfoutput>
> 
> Any help appreciated.
> 
> Will
> 
> 
> --------------------------------------------------------------------------
> ----
> Archives: http://www.mail-archive.com/[email protected]/
> To Unsubscribe visit
> http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
> send a message to [EMAIL PROTECTED] with 'unsubscribe' in
> the body.


-----------------------------------------------
Any opinions expressed in this message are those of the individual and not necessarily 
the company.  This message and any files transmitted with it are confidential and 
solely for the use of the intended recipient.  If you are not the intended recipient 
or the person responsible for delivering to the intended recipient, be advised that 
you have received this message in error and that any use is strictly prohibited.

Sapphire Technologies Ltd
http://www.sapphire.net
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to