Round() Function in Sql ?

Sabarimahesh
Posted by Sabarimahesh under Sql Server category on | Points: 40 | Views : 1084
SQL statement to create table

With FIVE Column
ID
NAME
Class
Markid
Mark

Insert Data into Table

insert into Table values(1,'Raja',7,1,45);
insert into Table values(2,'Sekar',7,1,56);
insert into Table values(3,'Ramesh',7,1,67);
insert into Table values(1,'Raja',7,2,47);
insert into Table values(2,'Sekar',7,2,53);
insert into Table values(3,'Ramesh',7,2,57);
insert into Table values(1,'Raja',7,3,45);
insert into Table values(2,'Sekar',7,3,56);
insert into Table values(3,'Ramesh',7,3,67);
insert into Table values(1,'Raja',7,4,65);
insert into Table values(2,'Sekar',7,4,56);
insert into Table values(3,'Ramesh',7,4,37);



select id, name,avg(mark) as Average,
round(avg(mark)) as Rounded_AVg
from Tablegroup by id;



Rounded in the sense 54.9 =55

Comments or Responses

Login to post response