Using LIMIT 1 in MySQL

后端 未结 5 2039
猫巷女王i
猫巷女王i 2021-02-01 02:54

When is it appropriate to add LIMIT 1 at the end of the query in MySQL. I normally add it in DELETE but I\'ve seen it being used with INSERT a and even UPDATE. Is it an overkill

5条回答
  •  旧巷少年郎
    2021-02-01 03:31

    I can't think of an instance where something that speeds up a query and makes it more secure at the same time could be called overkill. I'll put my vote in the good practice column.

提交回复
热议问题