SQL Group BY using strings in new columns
问题 I have a database of race results. Each race event has multiple classes. events table: event_id | event_date ---------+------------ 1 | 11/5/14 2 | 11/12/14 3 | 11/19/14 results table: result_event | name | class | position -------------+---------------+-------+----------- 1 | Jason Smith | 40 | 1 1 | David Johnson | 40 | 2 1 | Randy White | 30 | 1 1 | Billy Hansen | 30 | 2 2 | Wally Mann | 40 | 1 2 | Shawn Little | 40 | 2 2 | Eric Davis | 30 | 1 2 | Tom Handy | 30 | 2 I want to create a