correct way to create a pivot table in postgresql using CASE WHEN
- by mojones
I am trying to create a pivot table type view in postgresql and am nearly there! Here is the basic query:
select
acc2tax_node.acc, tax_node.name, tax_node.rank
from
tax_node, acc2tax_node
where
tax_node.taxid=acc2tax_node.taxid and acc2tax_node.acc='AJ012531';
And the data:
acc | name | rank …