Home >Database >Mysql Tutorial >Mysql高级之游标_MySQL

Mysql高级之游标_MySQL

WBOY
WBOYOriginal
2016-06-01 13:04:221222browse

什么是游标?select 语句也许一次性会取出来n条语句,那么游标便可以一次取出来select中的一条记录。每取出来一条,便向下移动一次!可以实现很复杂逻辑!

\

\

\

上面还有有一个问题,会多出来一条记录,怎样搞定?

原因在于continue,而不是选择exit;

\

如果用continue不行吗?是可以的,没发现上面带有逻辑上有点小问题吗?这样解决:调节一下顺序


可见有n多种方法,不就是语法问题吗!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn