MYSQL gets all the results, but first

Possible duplicate:
Mysql Offset Endless Strings

I am trying to get all the results for a query, but not the first one, I have the following, but it gives me an error, please help; Thank you

SELECT DISTINCT `memberID` FROM `discusComments` WHERE `topicID` = 4 ORDER BY `id` DESC OFFSET 1 
+6
source share
2 answers
 SELECT DISTINCT `memberID` FROM `discusComments` WHERE `topicID` = 4 ORDER BY `id` DESC limit 1,x 

where x is a number sufficient to hold all of your records.

or use 18446744073709551615 instead of x, that is, the maximum unsigned bigint value.

+13
source

Ignore the first line when you get results in your application. This is much neater than using an ugly query like:

 SELECT * FROM my_table LIMIT 1, 18446744073709551615 

Getting an extra line will not hurt your work.

+2
source

Source: https://habr.com/ru/post/895270/


All Articles