You state that I need to count items with similar prices. Given your sample data, your query works.
declare @table table (Store varchar(3), Item varchar(16), Price int, Cost int, Profit int)
insert into @table (Store, Item, Price, Cost, Profit)
values
('ABC','Beer',5,3,2),
('ABC','Beer',5,3,2),
('ABC','Beer',4,3,1)
SELECT
Store,
Item,
Count(Price) as CT,
Price,
Cost,
Profit
FROM @table
GROUP BY Store,Item,Price,Cost,Profit
However, if the Cost and Profit columns for each Store / Item / Count tuple is different, your grouping wouldn't show the results you want.
declare @table2 table (Store varchar(3), Item varchar(16), Price int, Cost int, Profit int)
insert into @table2 (Store, Item, Price, Cost, Profit)
values
('ABC','Beer',5,3,2), --notice change in cost and profit
('ABC','Beer',5,2,1), --notice change in cost and profit
('ABC','Beer',4,3,1)
SELECT
Store,
Item,
Count(Price) as CT,
Price,
Cost,
Profit
FROM @table2
GROUP BY Store,Item,Price,Cost,Profit
I assume in your real data, this is the case--that is your Cost and Profit are different. Thus, you need to remove those columns from the SELECT and GROUP BY in order to answer your question, I need to count items with similar prices. Additionaly, you may want to remove the Store column from the SELECT and GROUP BY as well.
SELECT
Store,
Item,
Count(Price) as CT,
Price
FROM @table2
GROUP BY Store,Item,Price