ฟังก์ชันSTR() ของ เซิร์ฟเวอร์ SQL
ตัวอย่าง
ส่งกลับตัวเลขเป็นสตริง:
SELECT STR(185);
ความหมายและการใช้งาน
ฟังก์ชัน STR() ส่งกลับตัวเลขเป็นสตริง
ไวยากรณ์
STR(number, length, decimals)
ค่าพารามิเตอร์
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 |
รายละเอียดทางเทคนิค
ทำงานใน: | SQL Server (เริ่มตั้งแต่ปี 2008), ฐานข้อมูล Azure SQL, Azure SQL Data Warehouse, Parallel Data Warehouse |
---|
ตัวอย่างเพิ่มเติม
ตัวอย่าง
ส่งกลับตัวเลขเป็นสตริง:
SELECT STR(185.5);
ตัวอย่าง
ส่งกลับตัวเลขเป็นสตริง:
SELECT STR(185.476, 6, 2);