O'Reilly Forums: Problem With Count() Function - O'Reilly Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Problem With Count() Function

#1 User is offline   kingtrocko 

  • New Member
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 15-December 11

Posted 15 December 2011 - 09:44 AM

this is my query:

SELECT trainings2.name AS trainingName, training.time AS trainingDuration
FROM training2, training
WHERE training2.code=training.code

the result would be:
----------------------------------
trainingName trainingDuration employeesCount
name1 time1 I dont know
name2 time2 I dont know
name3 time3 I dont know
name4 time4 I dont know
name5 time5 I dont know
name6 time6 I dont know

the problem is that also i want to query the numbers of employees that received the trainig but i dont know where to put the function count() in my query.

here are another extra tables that i think its necesary to query

traningRegistration has the next colums: trainingCode,employeeCode, etc...

employeesTable has the next columns: employeeCode, name..etc



remember i just need to display the NUMBERS of employees in the colum employeesCount NOT the name.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users