question

Binod avatar image
Binod asked

Records of particular column in a different group of records

Records of particular column in a different group of records
sqltsqldynamic-sql
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
VishalhSingh avatar image
VishalhSingh answered
If I had understood your question correctly the below would might help you: CREATE TABLE #Count(colA INT,COLB INT, COLC INT, COLD NCHAR(1)) INSERT INTO #Count VALUES(1,2,3,'A') INSERT INTO #Count VALUES(1,1,3,'A') INSERT INTO #Count VALUES(1,2,3,'A') INSERT INTO #Count VALUES(1,2,3,'A') SELECT COUNT(COLD) FROM #Count GROUP BY colA,COLB,COLC you might want to play a little to get accurate result set based on your schema and environment.
1 comment
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thanks Vishal
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.