Here am explain my problem with sample.
Its My Sample query.
SELECT * FROM public.crosstab(
$$VALUES ('na','sales', 1, 100)
,('na','sales1', 1, 1000)
, ('ba','sales', 2, 300) $$
,$$VALUES ('1'), ('2')$$
) AS pivot (na text,n text, co11 int, col2 int)
It Produce Result like this
Na N Col1 Col2
na sales 1000
ba sales 300
But I want to get like this
Na N Col1 Col2
na sales 100
na sales1 1000
ba sales 300
How to get that?. Why the above query produce that result?
am using postgresql 9.3