SQL - Does the order of WHERE conditions matter?

前端 未结 5 1581
误落风尘
误落风尘 2020-11-29 06:49

Assume that category_id is an index key (not primary key) of table books. Is there any difference between the following two SQL statements?

5条回答
  •  猫巷女王i
    2020-11-29 07:37

    SQL is declarative.

    In your example, you have told the engine/optimizer what you want... it will now work out the best way to do that (within reason and "cost" which would be off topic).

提交回复
热议问题