创建了索引
CREATE INDEX MasterIndex
ON [Attendance].[dbo].[Attendence] (location,createdby,program,batch,term)
尝试过查询
SELECT *
FROM [Attendance].[dbo].[Attendence] USE INDEX (MasterIndex) WHERE createdby='pravin' and term='Term III' and batch='80' and program='computer' and location='AMD'
错误
'INDEX'附近的语法不正确。如果这是作为a的一部分 表提示, 现在需要WITH关键字和括号。
答案 0 :(得分:3)
使用WITH子句
SELECT *
FROM [Attendance].[dbo].[Attendence] WITH (INDEX (MasterIndex)) WHERE ...