Coś takiego:
select * from UserLog l1
where Operation = 'Enter' and
not exists(select * from UserLog l2
where l1.user = l2.user and
l2.Operation = 'Exit' and
l2.Time > l1.Time)
Coś takiego:
select * from UserLog l1
where Operation = 'Enter' and
not exists(select * from UserLog l2
where l1.user = l2.user and
l2.Operation = 'Exit' and
l2.Time > l1.Time)
Pięć najważniejszych kwestii dotyczących projektowania indeksu bazy danych w programie SQL Server
Jak uzyskać czas z formatu DateTime w SQL?
zapytanie sql — pobierz różnicę czasu między przeciągnięciem — przesuń palcem dla pracownika
Wyjdź i cofnij wszystko w skrypcie w przypadku błędu
WSTAW wiele rekordów za pomocą SQL Server 2008