Also the GROUP BY clasue in SQL is a different beast than the group
attribute in cfquery
It is, and I think it's more what you're looking for. You don't have to
order a group by. By default, depending on your query, it would order it
the way it was entered.
SQL is really quite awesome, and
Is there a way to group output in a query and keep the groups together,
but with no order specified anywhere?
cfquery
Select myGROUP, mySubGROUP from myTABLE
!---(NO ORDER BY)---
/cfquery
I need output like:
1. myGROUP
a. mySUBGOUP 1
b. mySUBGOUP 2
2. myGROUP 2
a. mySUBGOUP 1
Only order the groups, not the subgroups?
On 4/11/06, Les Mizzell [EMAIL PROTECTED] wrote:
Is there a way to group output in a query and keep the groups together,
but with no order specified anywhere?
cfquery
Select myGROUP, mySubGROUP from myTABLE
!---(NO ORDER BY)---
/cfquery
I need
This idea may seem complicated, but it should work. Put the ORDER BY in the
SQL. Create an empty array. Do your cfoutput with the 'group' attribute. Use
cfsavecontent to put each Group's output into a variable in the array. Then
you can use some kind of randomizer to grab the output from the
To: CF-Talk
Subject: Group - but with no order specified
Is there a way to group output in a query and keep the groups
together,
but with no order specified anywhere?
cfquery
Select myGROUP, mySubGROUP from myTABLE
!---(NO ORDER BY)---
/cfquery
I need output like:
1. myGROUP
, April 11, 2006 3:00 PM
To: CF-Talk
Subject: Group - but with no order specified
Is there a way to group output in a query and keep the groups together,
but with no order specified anywhere?
cfquery
Select myGROUP, mySubGROUP from myTABLE
!---(NO ORDER BY)---
/cfquery
I need output like:
1
I'd suggest creating a SORT_ORDER (INTEGER) column for
each of the myGROUP records and ask your client what order he'd like
them in.
This is probably what's going to have to happen.
Otherwise, Yoda says, Solutions there are, but convoluted are they!.
If I add a ORDER to the query, it obviously works - but, the client
doesn't WANT them in any order. He just wants the groups together.
I'm not trying to sound like a wiseass, but just point out a
perspective: if the client doesn't care what order they're in, what's
the harm in ordering them?
It may well be that they don't not care. They may be specifically
asking that they not be in any sort of discernible order.
Why are you using the group in the cfoutput instead of in the query?
--Ferg
Joe Rinehart wrote:
If I add a ORDER to the query, it obviously works - but, the client
To: CF-Talk
Subject: Re: Group - but with no order specified
It may well be that they don't not care. They may be specifically
asking that they not be in any sort of discernible order.
Why are you using the group in the cfoutput instead of in the query?
--Ferg
Joe Rinehart wrote:
If I add
I'm not trying to sound like a wiseass, but just point out a
perspective: if the client doesn't care what order they're in, what's
the harm in ordering them?
Client wants it in the order he typed it in, not an alpha sort or
anything. What the client don't get though is that he's not
: Tuesday, April 11, 2006 2:53 PM
To: CF-Talk
Subject: Re: Group - but with no order specified
I'm not trying to sound like a wiseass, but just point out a
perspective: if the client doesn't care what order they're in, what's
the harm in ordering them?
Client wants it in the order he typed
Correct, but if a filed being 'GROUPED' in CF is not ORDERed in SQL, then
disinct items in the 'outer loop' may beoutput more than once.
For example:
cfset test = QueryNew('name,item') /
cfset queryAddRow(test,6) /
cfset querySetCell(test,'name','Bob',1) /
cfset
13 matches
Mail list logo