2012-01-18 35 views
-3

如何找出查詢返回的記錄數?SQL:選擇記錄數

例如,我有一個名爲Items的表,每個項目都有一個子類型ID。如何找出屬於子類型1的項目的行數?

回答

0

您可以使用下面的查詢。

select count(*) from items where item_subtype_id=1; 
3

您是否閱讀過SQL的介紹?

select count(*) 
from items 
where subtype = 1 

:)

0
select count(*) from Items where subtype_id = 1