|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
I have a database with the following values:
Item A, Boa, Snakes Item B, Boa, Snakes Item C, Boa, Snakes Item D, Python, Snakes Item E, Python, Snakes Item F, Collubrid, Snakes I want the output to look like this though: Snakes --> Boas --------> Item A --------> Item B --------> Item C --> Pythons --------> Item D --------> Item E --> Collubrid --------> Item F How do I structure this in CFML to give me this output? |
|
#2
|
|||
|
|||
|
Re: Select Distinct Command
Use CFOUTPUT with the GROUP attribute:
PHP Code:
You could also do this manually with nested loops, as you would have to do with PHP. But the group attribute makes it much easier. |
|
#3
|
|||
|
|||
|
sorry, i needed the SQL code for this too....what's the query look like??
<cfoutput query="myQuery" group="animalType"> #animalType#<br> <cfoutput group="animalName"> #animalName#<br> <cfoutput> #itemNo#<br> </cfoutput> </cfoutput> </cfoutput> |
|
#4
|
|||
|
|||
|
never mind, i got it!
great work, thanks for the speedy response. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Select Distinct Command |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|