Hi,
Any help would be greatly appreciated.
I'm trying to do a compile a report with coldfusion. The report will be in this format.
---------------------------------------------------------
|industry | government | finance | media
country| | | |
---------------------------------------------------------
africa | 5 7 9
belgium| 4 10
china | 10 4
denmark| 4 10
----------------------------------------------------------
this table is a flat table with 3 fields: name, country, industry
I need to do a count to see the breakdown of number of people in each country/industry. Some combination does not have any people in it. May I know the most efficient way to do this type of query as my actual database has about 50,000 records.
I am currently resorting to doing a first loop through all the country and then within the country loop, do a database query loop through all the industry. It works but very inefficient when the records are huge.
The solution may be something very basic so do bear with me. Thank you.
Regards,
Daniel
Any help would be greatly appreciated.
I'm trying to do a compile a report with coldfusion. The report will be in this format.
---------------------------------------------------------
|industry | government | finance | media
country| | | |
---------------------------------------------------------
africa | 5 7 9
belgium| 4 10
china | 10 4
denmark| 4 10
----------------------------------------------------------
this table is a flat table with 3 fields: name, country, industry
I need to do a count to see the breakdown of number of people in each country/industry. Some combination does not have any people in it. May I know the most efficient way to do this type of query as my actual database has about 50,000 records.
I am currently resorting to doing a first loop through all the country and then within the country loop, do a database query loop through all the industry. It works but very inefficient when the records are huge.
The solution may be something very basic so do bear with me. Thank you.
Regards,
Daniel