1

I just want to return 1 row with three columns

(SELECT count(1) from tests) TestCount, 
(select count(1) from customers) CustomerCount, 
(select count(1) from patients) PatientCount
4

2 回答 2

5

请试试:

select 
  (SELECT count(1) from tests) TestCount, 
  (select count(1) from customers) CustomerCount, 
  (select count(1) from patients) PatientCount
from dual;
于 2013-09-20T12:46:35.707 回答
0
SELECT  TestCount.TestCount,
        CustomerCount.CustomerCount,
        PatientCount.PatientCount
FROM    (SELECT count(1) TestCount from tests) TestCount
        CROSS JOIN
        (select count(1) CustomerCount from customers) CustomerCount
        CROSS JOIN
        (select count(1) PatientCount from patients) PatientCount
于 2013-09-20T12:46:24.063 回答