我查詢,但沒有顯示。如何查詢結果與分頁SQL服務器和PHP
請檢查我的語法。
SELECT TOP 100 [nUserID],[nDeviceID],[dtDateTime],[strUserName],[DeviceID],[DeviceName]
FROM
(
SELECT [tb_reportslist].nUserID,[tb_reportslist].nDeviceID,[tb_reportslist].dtDateTime,[DeviceID],[DeviceName],[strUserName],
ROW_NUMBER() OVER (ORDER BY [tb_reportslist].nUserID,[tb_reportslist].nDeviceID,[tb_reportslist].dtDateTime) AS RowNumber
FROM [hr_scan].[dbo].[tb_reportslist] INNER JOIN [hr_scan].[dbo].[imp_emp] ON tb_reportslist.nUserID = imp_emp.[nUserID]
INNER JOIN [hr_scan].[dbo].[Device_sukishi] ON tb_reportslist.nDeviceID = Device_sukishi.[DeviceID]
WHERE ((convert(date,[tb_reportslist].dtDateTime)) BETWEEN '2015-01-18' AND '2015-01-20') AND ([tb_reportslist].nUserID = '572420')
) EmployeePage WHERE RowNumber BETWEEN ((10 - 1) * 10 + 1) AND (10 * 10)
當我添加的語法AND ([tb_reportslist].nUserID = '572420'
((convert(date,[tb_reportslist].dtDateTime)) BETWEEN '2015-01-18' AND '2015-01-20')
後的結果沒有顯示
沒有人在這裏檢查語法你說什麼你的問題 – 2015-01-21 07:30:58
'LIMIT'是你的答案 – Class 2015-01-21 07:31:03
@Class,SQL Server中沒有LIMIT子句 – Ishamael 2015-01-21 07:35:24