I see ORDER BY addedOn DESC LIMIT in Mysql command in our apps
i don’t know Means of ORDER BY addedOn DESC LIMIT
so what is ORDER BY addedOn DESC LIMIT
I see ORDER BY addedOn DESC LIMIT in Mysql command in our apps i
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is ordering by addedOn in descending order and then limiting the results by the number of rows after the word LIMIT.
The definition of limit is from here
With two arguments, the first argument specifies the offset of the first row to return, and the second specifies the maximum number of rows to return. The offset of the initial row is 0 (not 1):
To retrieve all rows from a certain offset up to the end of the result set, you can use some large number for the second parameter. This statement retrieves all rows from the 96th row to the last:
With one argument, the value specifies the number of rows to return from the beginning of the result set:
In other words, LIMIT row_count is equivalent to LIMIT 0, row_count.
For prepared statements, you can use placeholders (supported as of MySQL version 5.0.7). The following statements will return one row from the tbl table:
The following statements will return the second to sixth row from the tbl table:
For compatibility with PostgreSQL, MySQL also supports the LIMIT row_count OFFSET offset syntax.
If LIMIT occurs within a subquery and also is applied in the outer query, the outermost LIMIT takes precedence. For example, the following statement produces two rows, not one: