Andy Dufresne
2013-07-25 10:14:51 UTC
select
id,
attempt,
question,
att_number,
answer,
timestamp,
event
from
mytable
gives me this output:
id attempt question att_number answer timestamp event
1296040 22059 3813 0 11960,11961,11959,11958: 1265006717 0
1296165 22059 3813 1 11960,11961,11959,11958:11960 1265011083 2
1296166 22059 3813 1 11960,11961,11959,11958:11960 1265011049 6
1296163 22059 3813 1 11960,11961,11959,11958:11960 1265011037 6
1296164 22059 3813 1 11960,11961,11959,11958:11960 1265011072 6
How do I select just the unique rows for the attempt, question, att_number, answer and event columns with the LOWEST value for the timestamp column?
I want this:
id attempt question seq_number answer timestamp event
1296040 22059 3813 0 11960,11961,11959,11958: 1265006717 0
1296165 22059 3813 1 11960,11961,11959,11958:11960 1265011083 2
1296163 22059 3813 1 11960,11961,11959,11958:11960 1265011037 6
Thanks
id,
attempt,
question,
att_number,
answer,
timestamp,
event
from
mytable
gives me this output:
id attempt question att_number answer timestamp event
1296040 22059 3813 0 11960,11961,11959,11958: 1265006717 0
1296165 22059 3813 1 11960,11961,11959,11958:11960 1265011083 2
1296166 22059 3813 1 11960,11961,11959,11958:11960 1265011049 6
1296163 22059 3813 1 11960,11961,11959,11958:11960 1265011037 6
1296164 22059 3813 1 11960,11961,11959,11958:11960 1265011072 6
How do I select just the unique rows for the attempt, question, att_number, answer and event columns with the LOWEST value for the timestamp column?
I want this:
id attempt question seq_number answer timestamp event
1296040 22059 3813 0 11960,11961,11959,11958: 1265006717 0
1296165 22059 3813 1 11960,11961,11959,11958:11960 1265011083 2
1296163 22059 3813 1 11960,11961,11959,11958:11960 1265011037 6
Thanks