I want to insert to the column checkinorout value checkin or checkout in first checkin and then checkout and then checkin based on the same SENSORID and the same checktime as you see
I want this
select
USERID, checktime, SENSORID, checkinoroutfrom
CHECKINOUTorderby
CHECKTIME
Output:
USERID checktime SENSORID checkinorout30592014-05-3109:02:08.000213NULL30592014-05-3117:27:23.000213NULL30592014-05-3119:27:23.000213NULL30592014-06-0108:03:07.000213NULL30592014-06-0117:23:59.000213NULL30592014-06-0208:05:11.000213NULL30592014-06-0217:21:22.000213NULL30592014-06-0307:47:21.000213NULL30592014-06-0507:57:22.000216NULL30592014-06-0509:57:22.000216NULL30592014-06-0511:57:22.000216NULL30592014-06-0509:57:22.000213NULL
to be
select
USERID, checktime, SENSORID, checkinoroutfrom
CHECKINOUTorderby
CHECKTIME
Output:
USERID checktime SENSORID checkinorout30592014-05-3109:02:08.000213 checkin30592014-05-3117:27:23.000213 checkout30592014-05-3119:27:23.000213 checkin30592014-06-0108:03:07.000213 checkin30592014-06-0117:23:59.000213 checkout30592014-06-0208:05:11.000213 checkin30592014-06-0217:21:22.000213 checkout30592014-06-0307:47:21.000213 checkin30592014-06-0507:57:22.000216 checkin30592014-06-0509:57:22.000216 checkout30592014-06-0511:57:22.000216 checkin30592014-06-0507:57:22.000213 checkin30592014-06-0509:57:22.000213 checkout