Limit in mysql

xiaoxiao2021-03-05  24

Previously, learned from Hibernate. If you want to query from Oracle from the N record started from the MRS, SQL should be: select * from (select row _. *, Rownum rownum_ from (SELECT ID, NAME, SEX from T_User) Row_ where rownum <= m n) Where rownum_> m

Today, I learned from Hibernate in MySQL: SELECT ID, NAME, SEX from T_User Limit M-1, N is right, or use Limit. It may be more useful to limit LIMIT 1000, return to the first 1000 records, in fact, Limit can also specify the starting line. But please note that the first parameter is line index instead of the line number, starting from 0.

转载请注明原文地址:https://www.9cbs.com/read-33877.html

New Post(0)