Hi all,
Here's a bit of a challenge. I have a single table storing category
information similar to any search engine. The table structure looks
like this
ID NameParentIDLevel
1 Computers 0 1
2 Laptop 1 2
3
look at the group attribute of cfoutput.
Should do what you want.
HTH,
Sam
- Original Message -
From: Dowdell, Jason G [EMAIL PROTECTED]
To: CF-Talk [EMAIL PROTECTED]
Sent: Tuesday, October 15, 2002 2:30 PM
Subject: group by in cfoutput
Hi all,
Here's a bit of a challenge. I
It does a portion of what I want. I need to restrict
the output of the group by to a max of 3 records per
parent category.
~jason
-Original Message-
From: Sam Farmer [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 15, 2002 3:11 PM
To: CF-Talk
Subject: Re: group by in cfoutput
look
Can you put maxrows=3 in the innermost CFOUTPUT?
-Original Message-
From: Dowdell, Jason G [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 15, 2002 3:15 PM
To: CF-Talk
Subject: RE: group by in cfoutput
It does a portion of what I want. I need to restrict
the output
PROTECTED]]
Sent: Tuesday, October 15, 2002 3:15 PM
To: CF-Talk
Subject: RE: group by in cfoutput
It does a portion of what I want. I need to restrict
the output of the group by to a max of 3 records per
parent category.
~jason
-Original Message-
From: Sam Farmer [mailto:[EMAIL PROTECTED]]
Sent
That's the piece I'm working on now.
It won't allow you to do that since you must
specify a query in order to specify maxrows.
~Jason
-Original Message-
From: Everett, Al [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 15, 2002 3:17 PM
To: CF-Talk
Subject: RE: group by in cfoutput
, child.name
Then you should be able to use your cfoutput group on id and sub-cfoutput
group on childid and come up with the 3 sub's you want...
hth
S. Isaac Dealey
Certified Advanced ColdFusion 5 Developer
www.turnkey.to
954-776-0046
Even if you can, I suspect it's not a very efficient method.
Can you put maxrows=3 in the innermost CFOUTPUT?
-Original Message-
From: Dowdell, Jason G [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 15, 2002 3:15 PM
To: CF-Talk
Subject: RE: group by in cfoutput
It does
AND p.level = 1)
WHERE
(
SELECT Count(*)
FROM category
WHERE category.parentID = c.parentID
AND category.ID c.ID
) = 2;
cfoutput query= group=parentname
#parentname#
cfoutput
#childname#
/cfoutput
/cfoutput
Jochem
9 matches
Mail list logo