请问各位大神们,为什么会有这样的结果?如果我想知道是否查到结果了,除了count(*)意外还有什么办法,因为不想那么复杂的查询,一个返回结果集,一个返回count(*)。

解决方案 »

  1.   

    For a SELECT with a LIMIT clause, the number of rows that would be returned were there no LIMIT clauseA SELECT statement may include a LIMIT clause to restrict the number of rows the server returns to the client. In some cases, it is desirable to know how many rows the statement would have returned without the LIMIT, but without running the statement again. To obtain this row count, include a SQL_CALC_FOUND_ROWS option in the SELECT statement, and then invoke FOUND_ROWS() afterward:
      

  2.   

    你是在MYSQL命令行下运行还是图形化管理工具中运行?
      

  3.   


    后台调用found_row()的结果作为输出参数,判断是否查询到