select count(*) from 表名
rs=stmt.executeQuery("SELECT count(1) FROM biao")
rs.next()
int a = rs.getInt(1)
select count(b.name) as mary出现的次数from
(
select a.name
from
(
select 姓名1 as name from 表
union all
select 姓名2 from 表
union all
select 姓名3 from 表
union all
select 姓名4 from 表
union all
select 姓名5 from 表
)a
where a.name = 'mary'
)b
如何计算数据库中数据表字段个数select 字段, count(*)
from table
where ...
group by 字段
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)