Home >> SQL >> FORMAT() aggregate function in SQL

FORMAT() aggregate function in SQL

FORMAT() find format how a field is to be displayed.

Syntax

FORMAT(column_name,format)

Exapmle

SELECT name,city, FORMAT(Now(),'YYYY-MM-DD') AS curdate FROM products;

Output

Soap     delhi      2017-05-11

Oil         delhi      2017-05-11

Post Your Comment

Next Questions
COUNT() aggregate function
LOWER() aggregate function
UPPER() aggregate function
INITCAP() aggregate function
SUBSTR() aggregate function
ASCII() aggregate function
LENGTH() aggregate function
TRIM() aggregate function
LTRIM() aggregate function
RTRIM() aggregate function
Create database
Drop database
Select database
Create table
Drop table
Truncate table
Insert query
Select table
Where clause
AND Clause
OR Clause
Update query
Delete query
Like clause
IN clause

Copyright ©2022 coderraj.com. All Rights Reserved.