... count(*) as rowscount, sum( case a.costamount when 0 then 0 else 1 end ) as rowscount_nonzero
Microsoft AX 2012, X++, C#, SQL server, SSRS, Java, JavaFX, Oracle, PL/SQL, Delphi - codes examples, step-by-step tutorials, experiences.
Thursday, November 17, 2022
sql server - How to count only rows where are non-zero value
In SELECT use this construction with CASE statement:
Subscribe to:
Posts (Atom)