答案 0 :(得分:1)
怎么样
select count(*) from
table_name
用法如下:
int count;
String table = ...
Statement st = ...
ResultSet rs = st.executeQuery("select count(*) from " + table);
while (rs.next()){
count = rs.getInt(1);
}
答案 1 :(得分:0)
如果您正在寻找查询以获取计数:
SELECT COUNT(*) FROM MyTable