SQLTeam.com | Weblogs | Forums

Sql server. assignment I need help with it

List the number of products and their names beginning with each letter of the alphabet. Only display the letter and count if there are at least three product names begin with the letter. The query should produce the result set listed below.

and it should produce a similar result, you guys can see in the picture that I am attaching it.

Any idea or example that can help me with it? Thanks.

select first_letter , count(*) 
from table 
group by first_letter 
having count(*) >= 3

Thanks very much and from your example, I was able to do also this way
select substring([ProductName],1,1) as ProductName,
** count([ProductName]) as Total**
** from [A01007660_Project].[dbo].[Products]**
** group by substring(ProductName,1,1)**
** having COUNT([ProductName]) >= 3**