0

In MySQL, I have data with the same id in the table. For example, I have 3 data with the id X now whenever I query

SELECT * FROM table WHERE id = X ORDER BY id

It will return me all 3 data having an id X Now I am looking for a solution to skip the first row from data which comes in the result.

I looked up in this answer and also LIMIT & OFFSET, but I did not get any proper solution. How can I skip the first row?

Dharman
  • 30,962
  • 25
  • 85
  • 135
TarangP
  • 2,711
  • 5
  • 20
  • 41

1 Answers1

2

Can you check this out:

SELECT * FROM table WHERE id = X ORDER BY id LIMIT 10 OFFSET 1;

Here is a Demo

In my Fiddle, there is 3 records with similar id(1). After executing query, output showing 2 records by skipping first record(from a total of 3)

Sinto
  • 3,915
  • 11
  • 36
  • 70