I have the following table:
Products:
ID Type StockExists 01 Cellphone T 02 Cellphone F 03 Apparrel T
I want to count the number of items with existing stocks, i.e. number of rows with StockExists='T' . I ran the request as:
Select count(StockExists) From [Items] where StockExists='T'
but he always comes back 1. What is the right way to do this?
Edit:
Also, how to perform another Count operation and add them together on the same line, for example,
Select count(StockExists) From [Items] where StockExists='T'` and `Select count(Type) From [Items] where Type='Cellphone'` ?
Victor mukherjee
source share