Ask a Question related to Coldfusion Database Access, Design and Development.
-
ranger #1
major join?
what i am trying to do to one poor table is:
.................................................. .....get all
departments....................................... ..............................
.................................. <cfquery name='getdepts'
datasource='survey_table'> SELECT DISTINCT(empDepartment) AS sdept FROM
#tblnm# </cfquery> ...........................use output from getdepts to get
count of how many people in each
department........................................ ...... <cfoutput
query='getdepts'> <cfset deptlst = '#sdept#'> <cfquery name='gtdptcnt'
datasource='survey_table'> SELECT COUNT(empDepartment) AS dptctz FROM
#tblnm# WHERE empDepartment = '#deptlst#' ; </cfquery>
.................................................. ..find out how many people in
each department fall into a certain category.................................
<cfquery name='gtdptcnt1' datasource='survey_table'> SELECT
COUNT(empDepartment) AS dptctz1 FROM #tblnm# WHERE (empDepartment =
'#deptlst#') AND (memdt <> 0) ; </cfquery>
.................................................. .........list departments, how
many people/how many in category, percent in category...................... is
there any way to do this as a join... keep getting messages that will only
report one entry, etc, etc. one table has 32 departments and 350 employees...
could be much larger.... churn, chur.... poor server. tnx in advance.
ranger Guest
-
Is left-join faster then inner join?
Some people said that using left-join is generally faster than inner join, is that true? Thanks... -
Major props to this NG
Although I've been on-line since compuserv, I'm new to Flash developing. After finding this NG accidentally, I just wanted to congratulate y'all on... -
NArray indexing order: row major vs column major
rubyists- am i the only one who finds the current NArray indexing order confusing: irb(main):001:0> na = NArray.to_na a=,] =>... -
HELP!!!...major problem
Please help...I have made a flash movie in 16:9 format (1777px x 1000px) which I need to convert to a format that can be reproduced by a DVD player... -
Major dissapointment
Hi group, The biggest dissapointment with Oracle so far: SQL> select count(*) from factTable; select count(*) from factTable * ERROR at line... -
DGH #2
Re: major join?
I would like to help, but I'm a bit befuddled by your variable table name, so
excuse me if I'm way off track. Would it help to use 'group by' to get counts
of employees within each department? Ex (query1): <cfquery name='query1'
datasource='????'> select count(employeeID) as empsindepartment, Department
from employeetable group by Department order by Department </cfquery> Then
loop over the departments? <cfloop query = 'query1'> <cfquery name='query2'
datasource ='???'> select count(employeeID) as empsincategory from
employeetable where Department=#query1.Department# and Category=whatever
</cfquery> Calculate percentages using query1.empsindepartment and
query2.empsincategory and output row for query1.department </cfloop> There
are faster ways to do this, but this is the simplest way I know, and it
shouldn't eat your server. (If I'm getting what your asking).
DGH Guest



Reply With Quote

