Skip to content
Advertisement

SQL count row where progres not done

Need some help, dont know the keyword of this problem to search online

I want to count some progres that isn’t done

table-example

when progres has step3 then its not counted

desired result from that example is 2, im trying to do it alone, and it doesnt work

help is needed, Thanks Ahead

Advertisement

Answer

One method uses count(distinct) and filters in the where clause:

Another fun way uses a difference:

If 'step3' can appear at most once per progres, the above can be simplified to:

Or using set operations:

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