我有下表:
项目:
ID Type StockExists
01 Cellphone T
02 Cellphone F
03 Apparrel T
我想count the number of items
使用现有库存,即 . 的行数StockExists='T'
。我正在执行查询;
Select count(StockExists)
From [Items] where StockExists='T'
但它总是返回 1. 正确的方法是什么?
编辑:
另外,如何执行另一个这样的 Count 操作并将它们添加到一行中,例如,
Select count(StockExists)
From [Items] where StockExists='T'` and `Select count(Type)
From [Items] where Type='Cellphone'` ?