MYSQL获得所有结果,但首先 [英] MYSQL get all results but first

查看:71
本文介绍了MYSQL获得所有结果,但首先的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
Mysql偏移无限行

Possible Duplicate:
Mysql Offset Infinite rows

我正在尝试获取查询的所有结果,而不是第一个,但有以下内容,但它给我一个错误,请帮忙;谢谢.

I am trying to get all results for a query BUT NOT the first one, I have the following but its giving me an error, please help; thanks.

SELECT DISTINCT `memberID` FROM `discusComments` 
WHERE `topicID` = 4 ORDER BY `id` DESC OFFSET 1

推荐答案

SELECT DISTINCT `memberID` 
FROM `discusComments` 
WHERE `topicID` = 4 
ORDER BY `id` 
DESC limit 1,x

其中x是一个足以容纳您所有记录的数字.

where x is a number enough great to contain all your records.

或使用x,即18446744073709551615,而不是x,即bigint unsigned的最大值.

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

这篇关于MYSQL获得所有结果,但首先的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆