0
我的問題是我使用查詢必須返回N值,當我第一次,然後 接下來的N值等我還有一些類型的排序按日期排序,按字等排序,asc和desc變體。在我使用按日期排序的情況下,我可以使用像id> N(在我的代碼中a> 3),即第一個id是4,最後一個id是9,然後在下一個查詢中第一個將是10和最後15等等,但是要做什麼如果我需要通過單詞名稱進行排序,我如何確定從哪個單詞開始?限制和排序,從什麼字開始下一個結果
select distinct s.a,w._word
from (
select a from edges
where a in
(
select distinct w._id
from edges as e
inner join words as w
on w._id=e.a
where w.lang_id=2
) and b in
(
select distinct w._id
from edges as e
inner join words as w
on w._id=e.b
where w.lang_id=1
)
union
select b from edges
where b in
(
select distinct w._id
from edges as e
inner join words as w
on w._id=e.b
where w.lang_id=2
) and a in
(
select distinct w._id
from edges as e
inner join words as w
on w._id=e.a
where w.lang_id=1
)
) as s
inner join words as w
on s.a=w._id
inner join groups_set as gs
on w._id=gs.word_id
where gs.group_id in (1,2,3) or w._word like '%d%' and a>3
order by w._word desc limit 5
是的,謝謝你的工作) – Abbath