P
ProgramFan
Unregistered / Unconfirmed
GUEST, unregistred user!
以下是我写的SQL语句
SELECT COUNT(*) AS A
FROM dbo.EmployeeAttend
WHERE (LineName = 'A')
UNION ALL
SELECT COUNT(*) AS B
FROM dbo.EmployeeAttend
WHERE (LineName = 'B')
UNION ALL
SELECT COUNT(*) AS 'C'
FROM dbo.EmployeeAttend
WHERE (LineName = 'C')
得到的结果是这样的
A
-----------
26
27
0
(所影响的行数为 3 行)
但是我想要的结果是这样的
A B C
-----------
26 27 0
要怎样才能改成这样呢!
SQL语句应该怎样写呢?
SELECT COUNT(*) AS A
FROM dbo.EmployeeAttend
WHERE (LineName = 'A')
UNION ALL
SELECT COUNT(*) AS B
FROM dbo.EmployeeAttend
WHERE (LineName = 'B')
UNION ALL
SELECT COUNT(*) AS 'C'
FROM dbo.EmployeeAttend
WHERE (LineName = 'C')
得到的结果是这样的
A
-----------
26
27
0
(所影响的行数为 3 行)
但是我想要的结果是这样的
A B C
-----------
26 27 0
要怎样才能改成这样呢!
SQL语句应该怎样写呢?