Skip to content Skip to sidebar Skip to footer

How To Count Rows With Rounded Valus In Sql Teradata?

I work in SQL Teradata. I would liek to count how many rows (clients) have rounded value in column 'amount' (means for example 140.00 not 157.76 and so on). I use code like below:

Solution 1:

Use a case expression:

sum(casewhen amount mod 1=0then1else0end)

I'm not 100% sure if Teradata supports mod 1. I would normally write this as:

sum(casewhen amount =floor(amount) then1else0end)

Post a Comment for "How To Count Rows With Rounded Valus In Sql Teradata?"