SUM(CASE WHEN maepos = 2 THEN 1 ELSE 0) AS pos2Count,
SUM(CASE WHEN maepos = 3 THEN 1 ELSE 0) AS pos3Count,
SUM(CASE WHEN maepos = 4 THEN 1 ELSE 0) AS pos1Count
FROM mae
----- Original Message -----
From: "Che Vilnonis" <
> Is there an easy/simple way to combine these four queries into one?
> I'm not thinking clearly today. :(
>
> SELECT COUNT (MAEPOS) AS Pos1Count
> FROM MAE
> WHERE MAEPOS = 1
>
> SELECT COUNT (MAEPOS) AS Pos2Count
> FROM MAE
> WHERE MAEPOS = 2
>
> SELECT COUNT (MAEPOS) AS Pos3Count
> FROM MAE
> WHERE MAEPOS = 3
>
> SELECT COUNT (MAEPOS) AS Pos4Count
> FROM MAE
> WHERE MAEPOS = 4
>
> Thanks Che
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

