-1
我已在sql中使用此查詢,請轉換此查詢以用於訪問數據庫。轉換sql查詢
表結構是用戶名,用戶名,LOGDATE,LOGTIME
WITH
[TableWithRowId] as
(SELECT ROW_NUMBER() OVER(ORDER BY UserId,LogDate,LogTime) RowId, * FROM @YourTable),
[OddRows] as
(SELECT * FROM [TableWithRowId] WHERE rowid % 2 = 1),
[EvenRows] as
(SELECT *, RowId-1 As OddRowId FROM [TableWithRowId] WHERE rowid % 2 = 0)
SELECT
[OddRows].UserId,
[OddRows].UserName,
[OddRows].LogDate,
[OddRows].LogTime,
[EvenRows].LogDate,
[EvenRows].LogTime
FROM
[OddRows] LEFT JOIN [EvenRows]
ON [OddRows].RowId = [EvenRows].OddRowId
@nisha這是關於http://stackoverflow.com/questions/2708525/ms-access-query-for-time? – Fionnuala 2010-04-26 10:39:20
是的,先生,它與它有關 – nisha 2010-04-26 10:45:02