How to use index in select statement?

前端 未结 8 618
误落风尘
误落风尘 2020-12-12 12:42

Lets say in the employee table, I have created an index(idx_name) on the emp_name column of the table.

Do I need to explicitly specify the index name in

8条回答
  •  春和景丽
    2020-12-12 13:19

    If you want to test the index to see if it works, here is the syntax:

    SELECT *
    FROM Table WITH(INDEX(Index_Name))
    

    The WITH statement will force the index to be used.

提交回复
热议问题