別の方法(CASE
なし 式):
SELECT
( SELECT COUNT(*)
FROM tblActor
WHERE ActorGender = 'm'
) AS MaleActors
, ( SELECT COUNT(*)
FROM tblActor
WHERE ActorGender = 'f'
) AS FemaleActors
FROM
dual ;
CROSS
によるその他のソリューション 参加:
SELECT m.MaleActors, f.FemaleActors
FROM
( SELECT COUNT(*) AS MaleActors
FROM tblActor
WHERE ActorGender = 'm'
) m
CROSS JOIN
( SELECT COUNT(*) AS FemaleActors
FROM tblActor
WHERE ActorGender = 'f'
) f ;