1,select count(*) from itemresult where itemid=2;
取得count(*)
2,from ItemResult where itemId=?
取得List<ItemResult>.size()
...全文
2275打赏收藏
select count(*) vs list.size()
大家好,使用hibernate链接MySQL查询,如果从一个库中查询数量,那么下面这两种方式那个效率好一些? 1,select count(*) from itemresult where itemid=2; 取得count(*) 2,from ItemResult where itemId=? 取得List.size()