Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Usage and simple example of sql format () function
Usage and simple example of sql format () function
The FORMAT () function is used to format the display of fields.

SQL FORMAT () syntax

Select FORMAT(column_name, FORMAT) from table_name.

Format (x, D): D Decimal digits are forcibly reserved. When the integer part exceeds three digits, it is separated by commas, and the returned result is string.

Select format (100.3465,2), format (100,2) and format (,100.6,2);

Results: They were 100.35, 100.00 and 100.60 respectively.