• 数据库查询后几条数据Mysql Oracle SQLServer


    (1)Mysql查询后几条数据
    a:mysql有自增主键
    select * from table order by tss desc limit 2
    b:mysql没有自增主键
    select count(*) from table
    select * from kj_commondate_jyck limit table数据量-1,1
    (2)Oracle查询后几条数据
    select * from (select t.*,rownum n from fi_kj_log t) where n > (select count(1)-10 from fi_kj_log) and n <= (select count(1) from fi_kj_log )
    (3)SQLServer查询后几条数据
    a:SQLServer有自增主键
    SELECT TOP N * FROM TABLE 按照自增id进行降序desc
    select pk_recbill from (select top 10 * from ar_recitem order by ts desc)a
     
    b:SQLServer没有自增主键
     
  • 相关阅读:
    NCPC2016
    2016 ACM-ICPC CHINA-Final
    2016沈阳区域赛题解
    NAIPC2016部分题解
    Gym
    数论之莫比乌斯反演
    2018 多校 HDU
    LightOJ
    LightOJ
    java操作XML---XML基础知识
  • 原文地址:https://www.cnblogs.com/nje19951205/p/14593411.html
Copyright © 2020-2023  润新知