why not just do a joined query?

SELECT
        c.SI_Category_name,
        i.si_item_name
FROM
        SI_categories c,
        si_items i
WHERE
        c.category_id = i.category_id
ORDER BY
        c.si_category_name, i.si_item_name

then, when you output, do a 


<TABLE>
<CFOUTPUT QUERY="qname" GROUP="si_category_name">
<TR>
<TD>#si_category_name#</TD>
</TR>
<CFOUTPUT>
...

Chris Olive,
DOEHRS Website Administrator 

-----Original Message-----
From: Kelly Matthews [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 01, 2000 10:56 AM
To: '[EMAIL PROTECTED]'
Subject: Help with OUTPUT of some Querys


Ok I have 2 tables One called SI_Categories it has
SI_Category_ID and SI_Category_Name

The other called SI_Items it has 
SI_Item_ID
SI_Item_NAme
SI_Category_ID

So basically SI_Items has the category ID for each item to show what
category it belongs to. All Good...
I want the output however to look like so.

Category1:
Item1
Item2
Item 3

Category2:
Item4
Item5
Item6

Category3:
Item7
Item8
Item9

I seem to be having trouble. Obviously something has to loop and maybe even
group (ooo a rhyme)
because once I pull all items I have the Category ID for each but need to go
back to the category table
to find out what that category actually is. Also need the categories
displayed BY NAME (from category table)
with the items for each category (item table) listed under the appropriate
Category. i am srue I am
missing something little. Any suggestions???

Should I do 2 separate queries or a join? I have tried quite a few things
and can't get it to work.
Kelly
----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
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.
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
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