LOG() Function in SQL Server Last Updated : 29 Sep, 2020 Comments Improve Suggest changes 1 Likes Like Report The LOG() function returns the logarithm of a specified number or the logarithm of the number to the specified base. Syntax : LOG(number, base) Parameter : LOG() function accepts two-parameters as mentioned above and described below. number - This parameter hold a number which is greater than 0. base - It is the optional integer argument that sets the base for the logarithm. Returns - It returns the logarithm of the specified number with specified base. Example-1 : Return the natural logarithm of 4. SELECT LOG(4); Output : 1.3862943611198906 Example-2 : It will Return the natural logarithm of 3 to a specified base 6. SELECT LOG(3, 6); Output : 0.61314719276545848 Example-3 : When the PI() function passing one of the arguments with specified base 5. SELECT LOG(PI(), 5); Output : 0.71126066871266902 Example-4 : When the argument passing as a expressions with specified base. SELECT LOG(3 + 2, 5); Output : 1.0 Example-5 : Both LOG and LOG10 having base 10. SELECT LOG(1000, 10) 'LOG', LOG10(1000) 'LOG10'; Output : | LOG | LOG10 | |-------+--------| | 3 | 3 | Create Quiz Comment S sanjoy_62 Follow 1 Improve S sanjoy_62 Follow 1 Improve Article Tags : SQL DBMS-SQL SQL-Server Explore BasicsWhat is SQL?6 min readSQL Data Types3 min readSQL Operators5 min readSQL Commands | DDL, DQL, DML, DCL and TCL Commands4 min readSQL Database Operations3 min readSQL CREATE TABLE3 min readQueries & OperationsSQL SELECT Query3 min readSQL INSERT INTO Statement4 min readSQL UPDATE Statement3 min readSQL DELETE Statement3 min readSQL - WHERE Clause2 min readAliases in SQL2 min readSQL Joins & FunctionsSQL Joins (Inner, Left, Right and Full Join)4 min readSQL CROSS JOIN1 min readSQL | Date Functions3 min readSQL | String functions6 min readData Constraints & Aggregate FunctionsSQL NOT NULL Constraint2 min readSQL PRIMARY KEY Constraint5 min readSQL Count() Function4 min readSQL SUM() Function2 min readSQL MAX() Function3 min readAVG() Function in SQL2 min readAdvanced SQL TopicsSQL Subquery5 min readWindow Functions in SQL6 min readSQL Stored Procedures7 min readSQL Triggers5 min readSQL Performance Tuning6 min readSQL TRANSACTIONS6 min readDatabase Design & SecurityIntroduction of ER Model9 min readIntroduction to Database Normalization6 min readSQL Injection11 min readSQL Data Encryption5 min readSQL Backup4 min readWhat is Object-Relational Mapping (ORM) in DBMS?7 min read Like