Ö»ÄÜʹÓ÷ǸºµÄÕûÊý The LIMIT clause can be used to constrain the number of rows returned by the SELECT statement. LIMIT takes one or two numeric arguments, which must both be non-negative integer constants (except when using prepared statements). ÄÇÔõô»ñÈ¡µÚ5ÌõºÍºó±ßµÄËùÓÐÊý¾ÝÄØ£¿ лл
µÚ5Ìõ: SELECT * from table LIMIT 4,1 ºó±ßµÄËùÓÐÊý¾ÝÄØ SELECT * from table LIMIT 4,100000
SQL code:
select count(*) into @cnt from table; select * from table where 1 limit 4,@cnt;
ÏÈÉÏ´íÎó ÎÞ·¨Áª½ÓÊý¾Ý¿â java.sql.SQLException: Before start of result set at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910) at com.mysql.jdbc.ResultSet.checkRowPos(ResultSet.java: ......
ÎÒÓõÄÊÇÁ¬½Ó³Ø×öµÄ£¬ÅäÁ¬½Ó³ØµÄ·½·¨Ó¦¸ÃûÓÐ´í£¬ÎªÊ²¾ÍÊdzöÏÖÕâÖÖÎÊÌâ javax.servlet.ServletException: javax.naming.NameNotFoundException: No object bound to name java:comp/env/test ÇëÎÊ´óÏÀÃÇÕâÊÇÔ ......