|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
CFQUERY SQL Help (Grouping problem)
Hello everyone,
I'm using ColdfusionMX + MS SQL and have a query problem. I have 2 tables, agenda and subAgenda Agenda AgendaID,Agenda_Title SubAgenda SubAgendaID, subAgenda_agendaID, subAgenda_title I need all of the subAgenda associated with an agenda, to show up under the agenda based on agenda.agendaID = subagenda.subagenda_AgendaID: The output should look like this: Agenda1 subagenda1 Agenda2 subagenda1 BUT This is what I'm getting Agenda1 subagenda1 Agenda1 subagenda2 Agenda1 subagenda3 Agenda2 subagenda1 Agenda2 subagenda2 Agenda2 subagenda3 It gives me an agenda with every subAgenda when I loop over the query. I know how to solve the problem with nested loops, but i figured this could be done in the SQL itself... Please help! Thanks, DjPizat |
|
#2
|
|||
|
|||
|
Try using
<cfoutput group="agendaID"> #agendaID# <cfoutput> #sugAgendaID# </cfoutput> </cfoutput>
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > CFQUERY SQL Help (Grouping problem) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|