my DB is
country| id |Plan
DE | XX1 | P
US | XX2 | W
US | XX3 | P
DE | XX4 | P
my output shd like
Plan_|_DE_|_US
W | 0 | 2
P | 2 | 1
i m using DECODE option, not getting exact output...Pl help me
SELECT plan,count(DECODE(country,'DE',id)),count(DECODE(c ountry,'US',id))
from MDL ORDER BY Plan;