下面是我的查询语句,用于分页:
SELECT DISTINCT email_list.*, email_counter.phone as e_phone,email_counter.email as e_email,email_counter.marketing as e_marketing
FROM Data_TLS_builders as email_list
LEFT JOIN wp_pato_email_list_counters as email_counter on email_counter.email_id = email_list.URN
LIMIT 120 OFFSET 150
与其从120开始,到150结束,应该显示30个结果,但是mysql返回了120个结果并忽略了偏移量。我尝试过
LIMIT 120,150
,但结果仍然相同。有什么解决办法吗?
LIMIT 30, OFFSET 120
来显示从第120行开始的30个结果。 - KamehamehaLIMIT
时,应该始终使用ORDER BY
。否则,所选择的行是不确定的。 - Gordon Linoff