gpt4 book ai didi

mysql - 为什么在 MySQL SELECT 语句中甚至允许使用 "LIMIT 0"?

转载 作者:IT王子 更新时间:2023-10-29 00:38:11 26 4
gpt4 key购买 nike

Limit 0, 1000 返回前 1000 个结果,但 LIMIT 0 返回 0 个结果。

恕我直言,这不是很直观。例如,愚蠢的老我认为删除 1000 会删除 SELECT 查询的上限,从而返回所有结果。

为什么有人甚至想查询 MySQL 的 0 个结果?

最佳答案

来自MySQL documentation

LIMIT 0 quickly returns an empty set. This can be useful for checking the validity of a query. When using one of the MySQL APIs, it can also be employed for obtaining the types of the result columns.

关于mysql - 为什么在 MySQL SELECT 语句中甚至允许使用 "LIMIT 0"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30269084/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com