Multiple Results with crosstab function

Started by Sven Haagalmost 15 years ago1 messagesgeneral
Jump to latest
#1Sven Haag
sven-haag@gmx.de

Hi postgres fans,

i'm already using the crosstab function but it shows up an issue with multiple results in the same category. example table:

row_name cat value
----------+-------+-------
row1 cat1 val1
row1 cat1 val2
row1 cat3 val3
row1 cat4 val4
row2 cat1 val5
row2 cat2 val6
row2 cat2 val7
row2 cat4 val8

the crosstab function (as far as i know) usually assumes that only 1 value belongs to 1 category. but unfortunatelly in our database it is possible that 1 category has 2 or more values.

is there a way to tell the crosstab function that it should show 2 rows when there is more then 1 value per category? by now only the first value of the selection criteria is shown.

thanks in advance for every hint.
sven

ps: http://stackoverflow.com/questions/5622981/multiple-results-with-postgresql-crosstab-function

--
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de