select
id,
attempt,
question,
att_number,
answer,
timestamp,
event
from
mytable
给我这个输出在MSSQL 2008 R2:SQL:选择唯一行
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
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
如何选择只具有最低的尝试,问题,att_number,答案和事件列中的唯一行时间戳列的值?
我想这一点:
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
不回答问题 - >'与最低值的时间戳列' –
@MitchWheat我编辑了答案,谢谢! – Parado
可能只能巧合工作,如果id是身份... –