Skip to content
Advertisement

T SQL Count and Group by calculable column

This code

gives the following table

cntqueue cntdate cntINKTONERBLACK signalcolumn
Queue01 2001-04-04 3 0
Queue01 2001-04-05 1 0
Queue01 2001-04-06 100 1

Is there a way to count ‘1’ in signal column and group 1st column to have?

cntqueue NumberOfJumps
Queue01 1

Advertisement

Answer

You can use a subquery:

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement