Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

round function issues

SELECT NR_R
FROM SCHEMA1.TABLE_1
where NR_R>
(select round(AVG(NR_R)) FROM SCHEMA1.TABLE_1 )  

i tried round function as above
and
also as below

SELECT NR_R
FROM SCHEMA1.TABLE_1
where NR_R>
(select ROUND(AVG(NR_R)) FROM SCHEMA1.TABLE_1 )  

both of them not working
are these function names and other variable names etc case sensitive?
can yo please advise
error i get is round needs 2,3 arguments which is not clear to me
Msg 189, Level 15, State 1, Line 4
The round function requires 2 to 3 arguments.
ASKER CERTIFIED SOLUTION
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
T-SQL functions are not case sensitive but ROUND requires 2 parameters at least.
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

If this isn't Oracle, can you remove that Topic?
If this would have been Oracle then I would not expect the "The round function requires 2 to 3 arguments." error message.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gudii9

ASKER

SELECT ROUND(9.85, 1)

above worked
@gudii9,

Please do not include Oracle for non-Oracle questions.
SELECT ROUND(9.85, 1)
    above worked

Yet you picked ROUND (..., 0) as the correct answer. Interesting.