Fungsi SQL Server STR()
Contoh
Kembalikan angka sebagai string:
SELECT STR(185);
Definisi dan Penggunaan
Fungsi STR() mengembalikan angka sebagai string.
Sintaksis
STR(number, length, decimals)
Nilai Parameter
Parameter | Description |
---|---|
number | Required. The number to convert to a string |
length | Optional. The length of the returning string. Default value is 10 |
decimals | Optional. The number of decimals to display in the returning string. Default value is 0 |
Detail Teknis
Bekerja di: | SQL Server (dimulai dengan 2008), Azure SQL Database, Azure SQL Data Warehouse, Parallel Data Warehouse |
---|
Lebih Banyak Contoh
Contoh
Kembalikan angka sebagai string:
SELECT STR(185.5);
Contoh
Kembalikan angka sebagai string:
SELECT STR(185.476, 6, 2);