· 8 years ago · Mar 05, 2018, 05:20 PM
1drop table if exists all_attempts;
2create table all_attempts
3(select personname, personid, eventid, competitionid, roundtypeid, value1 as time from results
4where value1 is not null and value1 != 0 and value1 != -2)
5union all
6(select personname, personid, eventid, competitionid, roundtypeid, value2 as time from results
7where value2 is not null and value2 != 0 and value2 != -2)
8union all
9(select personname, personid, eventid, competitionid, roundtypeid, value3 as time from results
10where value3 is not null and value3 != 0 and value3 != -2)
11union all
12(select personname, personid, eventid, competitionid, roundtypeid, value4 as time from results
13where value4 is not null and value4 != 0 and value4 != -2)
14union all
15(select personname, personid, eventid, competitionid, roundtypeid, value5 as time from results
16where value5 is not null and value5 != 0 and value5 != -2);