sql 查询一个表中有多少条数据

2025-06-21 06:07:33
推荐回答(3个)
回答1:

  1. select count(*) from  tablename   t
    2.select count(1) from  tablename  t
    3.select last_value(ROWNUM) over() as TOTAL  from tablename   t

  2. 只统计数量,第二种最合适

回答2:

select count(*) from tablename

回答3:

select count(*) from 表名