select ds_novel_text.textid, ds_novel_chapter.* 
from ds_novel_text,ds_novel_chapter 
where ds_novel_text.chapterid = ds_novel_chapter.chapterid 
and ds_novel_text.bookid=某数字
order by ds_novel_chapter.orderid asc,ds_novel_text.orderid asc
上面可以列出我需要的顺序。
ds_novel_chapter 是小说的分卷表 orderid 排序 主键chapterid
ds_novel_text  是小说的章节内容表 orderid 排序 主键textid 有chapterid字段我现在想求 某一章节的 下一章节和上一章节的textid大概这意思~

解决方案 »

  1.   

    感觉模糊
    textid里面是自增长类型还是什么
      

  2.   

    lz,你说说你的ds_novel_text 的格式如何的?
      

  3.   

    不写了,大概一说吧:上个
    select top 1 * from chapterid  where chapterid > 现在的ID order by chapterID desc下个
    select top 1 * from chapterid  where chapterid < 现在的ID order by chapterID asc
    自己再灵活一下吧
      

  4.   

    textid里面是自增长类型ds_novel_text 的格式如何的?
    textid textname chapterid orderid ……
    上个
    select top 1 * from chapterid  where chapterid > 现在的ID order by chapterID desc
    下个
    select top 1 * from chapterid  where chapterid < 现在的ID order by chapterID asc
    这个行不通才问的。排序是根据2个数排序的