An inner join returns one item on the right and one item on the left for every equality. So if one item on the left matches 5 items on the right, you will get 5 rows returned because there are 5 matches between rows on the left and rows on the right.
Now, that said...what do you want? You never specify in your message what you want to get out of your query. Do you want a count of the items on the right that are associated with each item on the left? Do you want to show all the items on the right that are associated with items on the left? Something else? Start by figuring out and communicating what you want to be outputting. Once you know that, then we can help you figure out how to get that data. Right now you are trying to figure out the answer without specifying the question. Cheers, Judah On Sat, Mar 7, 2009 at 10:59 AM, Jason Congerton <[email protected]> wrote: > > Hi > > I am joining two tables, together, there will always be one record in the > left table associated to serveral in the right. When i query the tables, i > always get to many records displayed. i.e if there are 5 items in the left > table associated to 24 items in the right table instead of getting 5 rows i > get 24. I applied a group on my cfoutput gp_name(unique) which makes it > better but not right, here is my query > > <cfquery name="get_global_products" datasource="#application.dsn#"> > SELECT gp_product_templates.gp_id, gp_product_templates.gp_name, > gp_product_templates.gp_ref, gp_product_templates.gp_manf, > gp_product_templates.gp_cat, gp_product_templates.gp_sub_cat, > gp_product_templates.gp_length, gp_product_templates.gp_width, > gp_product_templates.gp_height, gp_product_templates.gp_weight, > gp_product_templates.gp_stock_qty, gp_product_templates.gp_accs, > gp_product_templates.gp_stock_au, gp_product_templates.gp_stock_order_au, > gp_product_templates.gp_stock_arrival_au, gp_product_templates.gp_stock_eu, > gp_product_templates.gp_stock_order_eu, > gp_product_templates.gp_stock_arrival_eu, gp_image_library.gp_image_id, > gp_image_library.gp_image_name, gp_image_library.gp_image_url, > gp_image_library.gp_image_description, gp_image_library.gp_image_product_id, > gp_image_library.gp_website_name, gp_image_library.gp_image_type > FROM gp_product_templates INNER JOIN gp_image_library ON > gp_product_templates.gp_id = gp_image_library.gp_image_product_id > </cfquery> > > <cfqoutput query="thababove" group="gp_name"> > </cfoutput> > > Any ideas > > Jason > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320213 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

