如:select count(*) from tab1 where publi_id='1000000141' and cent_id='3702000001'
它是先根據條件利用where查詢出所有數據,然後利用count將每條數據彙總,就是算一下有多少條數據
如:select count(*) from tab1 where publi_id='1000000141' and cent_id='3702000001' group by comp_id
它是先根據where條件查詢出所有的數據,然後按照group by 來對comp_id進行分組,分完組後count會對每組的每條數據進行彙總
(注意:group by 後,count是對每組中的數據進行彙總)