Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have table about 1,000,000 rows. this query work well:

SELECT * FROM `articles`
WHERE `articles`.`hash` NOT
IN (
'1z8y'
)
LIMIT 2000,10 

But this query return zero rows:

SELECT * FROM `articles`
WHERE `articles`.`hash` NOT
IN (
'1z8y'
)
LIMIT 800000,10 

What's my problem? Any configure or etc?

share|improve this question
    
LIMIT is applied after WHERE. Are you sure you have more than 800k records where hash is not equal 1z8y ? –  a1ex07 Jul 22 '13 at 2:33
    
LIMIT 800000,10 will return 10 records after 800000 records but it looks like you didn't have 800000 records which satisfy your where clause. –  Abdul Manaf Jul 22 '13 at 3:58
    
how many rows of data, you are getting for the first query? –  Praveen Prasannan Jul 22 '13 at 4:55

1 Answer 1

up vote 2 down vote accepted

Table have 1,000,000 records but It look like Table doesn't have 800000+ records where

`articles`.`hash` NOT
IN (
'1z8y'
)

But table have 2000+ records where

`articles`.`hash` NOT
IN (
'1z8y'
)

LIMIT 800000,10 will return 10 records after 800000th records but it looks like you didn't have 800000 records which satisfy your where clause condition.

You can find no. of records which satisfy your where clause using this query

SELECT Count(*) FROM `articles`
WHERE `articles`.`hash` NOT
IN (
'1z8y'
)
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.