Skip to content

crosstab #70

@chrismo

Description

@chrismo

I could have swore I'd made a note somewhere along the way about how to crosstab with zq ... but - while it's not that hard, here's a decent SQL way to do it:

      SELECT
          coalesce(grid_type, 'Total') as _,
          SUM(CASE WHEN win = true THEN count ELSE 0 END) AS win,
          SUM(CASE WHEN win = false THEN count ELSE 0 END) AS loss
        GROUP BY _

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions