What will be the output for sql query SELECT truncate ( 124.56 , -2 ) ?
Answers
Answered by
1
✿ Answer :-
SELECT truncate ( 124.56 , -2 )
Output :- 100
_____________________
SQL Truncate is a data definition language (DDL) command. It removes all rows in a table. SQL Server stores data of a table in the pages. The truncate command deletes rows by deallocating the pages
Answered by
0
The following example uses both TRUNCATE() and ROUND() function for comparison:
SELECT TRUNCATE(1.999,1), ROUND(1.999,1);
C0de language: SQL (Structured Query Language) (sql)
Here is the query output:
100
As clearly shown in the ou_tput, the TRUNCATE() function only trims the decimal places while the ROUND() function performs the rounding.
Similar questions