Funzione SQL Server STR()
Esempio
Restituisce un numero come stringa:
SELECT STR(185);
Definizione e utilizzo
La funzione STR() restituisce un numero come stringa.
Sintassi
STR(number, length, decimals)
Valori dei parametri
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 |
Dettagli tecnici
Funziona in: | SQL Server (a partire dal 2008), Database SQL di Azure, Azure SQL Data Warehouse, Parallel Data Warehouse |
---|
Altri esempi
Esempio
Restituisce un numero come stringa:
SELECT STR(185.5);
Esempio
Restituisce un numero come stringa:
SELECT STR(185.476, 6, 2);