0
在这个SQL查询中有25条记录 我想得到5到10之间。我该怎么做? 我用11克Oracle数据库Rownum之间
select
(
select count(*) as sayfasayisi
from konular t
where t.kategori is not null
) as sayfasayisi,
t.id,
t.uye,
t.baslik,t.mesaj,t.kategori,t.tarih,
t.edittarih,t.aktif,t.indirimpuani,t.altkategori,t.link,
nvl(
(select case when t.id = f.konuid and f.uye = 'test' then '1' else '0' end
from takipkonu f where t.id = f.konuid and f.uye = 'test'), '0') as takip
from konular t
where t.kategori is not null
Oracle不会为记录分配永久行号,所以如果您要查找表中的第5到第10条记录,请知道它不能保证你每次都会得到相同的记录。对于您的具体问题,您需要查看您仅检索这些记录的具体要求。 – Incognito
您可以使用'ROW_NUMBER()'进行一定的排序,然后只保留第5到第10条记录。 [见这里](https://stackoverflow.com/questions/7480243/sql-oracle-order-by-and-limit)。 –