2 counts in 1 insert query

sven2

Registered User.
Local time
Today, 22:15
Joined
Apr 28, 2007
Messages
297
Hello,

is it possible to make a query that insert 2 counts into a tabel.

This is the insert:

INSERTINTO TempGraph(departmentname, CountEmpl, MaxEmpl)

this is the first count:
SELECT department.departmentname,COUNT(department.departmentname)As countEmpl
FROM Courses
GROUPBY department.departmentname

this is the second count:
SELECT
department.departmentname,COUNT(department.departmentname)As MaxEmpl
FROM Employees
GROUPBY department.departmentname

Can I do this in 1 step?

Thanks in advance,
Sven.
 
Here's an Idea:
INSERTINTO TempGraph(departmentname, CountEmpl, MaxEmpl) values
(department.departmentname, DCount(-count from courses-), DCount(-count from Employees-))
 

Users who are viewing this thread

Back
Top Bottom