Aggregate function module did not specify decimal place for round

Hello,
I understand how to use round, but am a bit confused by this instance:


if you look at the left side and ignore whatever I typed, it says:

select round(imdb_rating), count (name) from movies…
I thought that whenever you use round you MUST include how many decimal places you want it to round to otherwise sql gives an error. How come this example was formatted this way? I expected it to look more like:
select round(imdb_rating, 1), count (name) from movies…

any help would be appreciated! thank you

They’re using SQLite. Here’s the documentation for round(): SQLite Built-In Scalar SQL Functions

round( X )
round( X , Y )

The round(X,Y) function returns a floating-point value X rounded to Y digits to the right of the decimal point. If the Y argument is omitted, it is assumed to be 0.

It defaults to 0 if a second argument isn’t supplied

3 Likes

oh, I tried doing it in sql without any other number and it gave me an error. I guess it’s because it’s sqlite… THANK YOU SO MUCH, I’ve been pulling my hair out :rofl:

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.