Ask a Question related to Coldfusion Database Access, Design and Development.
-
bika_123 #1
Getting data from multiple rows into a list
I have a table that has values as follows:
PersonID Degree
55 MD
55 Phd
55 RN
60 MD
60 Phd
I need a create a query that will give me output like this:
PersonID Degree
55 MD, Phd, RN
60 MD, Phd
Any ideas
bika_123 Guest
-
How do I keep a fixed list of rows in a table?
Probably not making myself clear with that subject. Here is what I want to do. I want to basically implement a FIFO (FirstInFirstOut) queue in... -
Multiple rows of data into 1 row
I have a Pt ID field which is a unique number. I have a S_field which is an ID # that lines to the Pt ID. There are multiple Pt ID's for one... -
Update multiple rows data with a single button
hello I have been trying to run multiple update queries based on the data entered by user. Brief background: I am fetching data from various... -
Display 1 data row as multiple datagrid rows
If a row of data in a dataset has a lot of columns the row displaying the data in a datagrid will run way off the screen. What I'd like to do is... -
How would I insert multiple rows of data from one form?
Dear ASP.NETers, How would I insert multiple rows of data from a web form? Are there any tute's and stuff around. Couldn't find any myself. ... -
SaraGillie #2
Re: Getting data from multiple rows into a list
I would recommend using a cursor, loops and a temporary table. Here's some
pseudo code:
Retrieve all PersonIDs
Loop over each PersonID
Get all Degrees for PersonID
Create ListDegree variable
Loop over each Degree
Append Degree to the end of ListDegree
End Degree Loop
Insert PersonID, ListDegree into a temporary table
End PersonID Loop
Select records from temporary table
SaraGillie Guest
-
Dan Bracuk #3
Re: Getting data from multiple rows into a list
Start with a simple query, ordering by personid. That gets you the output as
shown in the orginal post. Then do something like this:
<cfset thisid = 0>
<cfoutput query="yourquery">
<cfif personid is not thisid>
<br>#personid# <cfset thisid = personid>
</cfif>
#degree#
</cfoutput>
Dan Bracuk Guest



Reply With Quote

