Questions tagged «crosstab»

6
PostgreSQL交叉表查询
有谁知道如何在PostgreSQL中创建交叉表查询? 例如,我有下表: Section Status Count A Active 1 A Inactive 2 B Active 4 B Inactive 5 我希望查询返回以下交叉表: Section Active Inactive A 1 2 B 4 5 这可能吗?
196 sql  postgresql  pivot  case  crosstab 

12
MySQL-行到列
我尝试搜索帖子,但仅找到SQL Server / Access的解决方案。我需要MySQL(5.X)中的解决方案。 我有一个包含3列的表(称为历史记录):hostid,itemname,itemvalue。 如果我选择(select * from history),它将返回 +--------+----------+-----------+ | hostid | itemname | itemvalue | +--------+----------+-----------+ | 1 | A | 10 | +--------+----------+-----------+ | 1 | B | 3 | +--------+----------+-----------+ | 2 | A | 9 | +--------+----------+-----------+ | 2 | c | 40 | +--------+----------+-----------+ …
185 mysql  sql  pivot-table  etl  crosstab 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.