Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

SUM and Group using IN clause

$
0
0
Hi, I am looking for a way to create a query to SUM and Group BY by using IN clause similiar to below.Is this possible or is another method recommended?SELECT CID, SUM(Hours) WHERE CID IN mycodes,FROM MyClrTblWHERE MyCodes IN ('Full', 'part', 'Contract')GROUP BY ID, MyCodes Basically, I want to end up with a table that shows:ID Full Part Contract and the values for each underneath each row.

Viewing all articles
Browse latest Browse all 3145

Trending Articles