0

OFFSET is not working

SELECT
  iContentID,
  vTitle,
  vContectNo
FROM
  `tbl_contact_list`
WHERE
  `eStatus` = Active AND `eDeleted` = 0
ORDER BY
  `vTitle` ASC OFFSET 0

Getting below error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'offset 0' at line 1

phpmyadmin Version information: 4.0.10deb1
database Server version: 5.5.54-0ubuntu0.14.04.1 - (Ubuntu)
PHP version 7

1 Answer 1

3

Looking at the syntax for SELECT:

[LIMIT {[offset,] row_count | row_count OFFSET offset}]

You need a LIMIT first to specify the maximum number of rows to return.

See also this question for more details on usage.

(BTW, OFFSET 0 is unnecessary as it is the default)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.