Sybase
Sybase ascii ( string_expression ) ส่งคืนตัวเลขที่แทนค่ารหัส ascii ของอักขระที่อยู่ซ้ายสุดของ "string_expression" ตัวอย่าง: ascii ( 'A' ) ผลลัพธ์: 65 char ( integer_expression ) แปลง "integer_expression" เป็นค่าอักขระ โดยทั่วไป Char จะใช้เป็นส่วนกลับของ ascii โดยที่ "integer_expression" ต้องอยู่ระหว่าง 0 และ 255 ถ้าค่าที่เป็นผลลัพธ์เป็นไบต์แรกของอักขระที่มีหลายไบต์ อาจไม่ได้กำหนดอักขระไว้ charindex ( string_expression1 , string_expression2 ) ส่งคืนจำนวนเต็มที่แทนตำแหน่งเริ่มต้นของ "string_expression1" ภายใน "string_expression2" ถ้าไม่พบ "string_expression1" จะส่งคืนศูนย์ ถ้า "string_expression1" มีอักขระไวด์การ์ด charindex จะถือว่าเป็นตัวอักษร concat ( string_expression1 , string_expression2 ) ส่งคืนสตริงที่เป็นผลลัพธ์ของการรวม "string_expression1" กับ "string_expression2" ตัวอย่าง: concat ( [Sales (query)].[Sales staff].[First name], [Sales (query)].[Sales staff].[Last name] ) ผลลัพธ์: ส่งคืนชื่อและนามสกุล เช่น Bob Smith datalength ( string_expression ) ส่งคืนความยาวเป็นไบต์ของ "string_expression" dateadd ( ' { ' datepart ' } ' , integer_expression , date_expression ) ส่งคืนวันที่ที่เป็นผลลัพธ์จากการเพิ่ม "integer_expression" หน่วยที่ระบุโดย datepart (day, month, year) เข้ากับ "date_expression" โปรดสังเกตว่า "datepart" ต้องอยู่ในวงเล็บปีกกา ตัวอย่าง: dateadd ( {dd} , 16 , 1997-06-16 ) ผลลัพธ์: Jul 2, 1997 datediff ( ' { ' datepart ' } ' , date_expression1 , date_expression2 ) ส่งคืนจำนวนของหน่วยที่ระบโดย "datepart" (day, month, year) ระหว่าง "date_expression1" และ "date_expression2" โปรดสังเกตว่า "datepart" ต้องอยู่ในวงเล็บปีกกา ตัวอย่าง: datediff ( {yy} , 1984-01-01 , 1997-01-01 ) ผลลัพธ์: 13 datename ( ' { ' datepart ' } ' , date_expression ) ส่งคืน "datepart" ของ "date_expression" เป็นสตริง ASCII "Date_expression" สามารถเป็นค่า datetime, smalldatetime, วันที่หรือเวลา โปรดสังเกตว่า "datepart" ต้องอยู่ในวงเล็บปีกกา ตัวอย่าง: datename ( {mm} , 1999-05-01 ) ผลลัพธ์: May datepart ( ' { ' datepart ' } ' , date_expression ) ส่งคืน "datepart" ของ "date_expression" เป็นจำนวนเต็ม "Date_expression" สามารถเป็นค่า datetime, smalldatetime, วันที่หรือเวลา โปรดสังเกตว่าอาร์กิวเมนต์ datepart ต้องอยู่ในวงเล็บปีกกา ตัวอย่าง: datepart ( {mm} , 1999-05-01 ) ผลลัพธ์: 5 day ( date_expression ) ส่งคืนวันของเดือน (1-31) จาก "date_expression" difference ( string_expression1 , string_expression2 ) ส่งคืนค่าจำนวนเต็มที่แทนความแตกต่างระหว่างค่าที่ส่งคืนโดยฟังก์ชัน data source-specific soundex สำหรับ "string_expression1" และ "string_expression2" ค่าที่ส่งคืนมีช่วงจาก 0 ถึง 4 ที่ 4 หมายถึงตรงกันที่สุด โปรดสังเกตว่า 4 ไม่ได้หมายถึงสตริงเท่ากัน ตัวอย่าง: difference ([Sales target (query)].[Sales staff].[First name],[Sales (query)].[Retailers].[Contact first name]) ผลลัพธ์: 0 ตัวอย่าง: difference ([Sales target (query)].[Sales staff].[First name],[Sales target (query)].[Sales staff].[First name]) ผลลัพธ์: 4 getdate () ส่งคืนวันที่และเวลาระบบปัจจุบัน left ( string_expression , integer_expression ) ส่งคืน "integer_expression" อักขระที่อยู่ซ้ายสุดของ "string_expression" ตัวอย่าง: left ( [Sales (query)].[Sales staff].[Last name] , 3 ) ผลลัพธ์: ส่งคืนอักขระสามตัวแรกของแต่ละนามสกุล ltrim ( string_expression ) ส่งคืน "string_expression" ที่ลบช่องว่างที่นำหน้าออก month ( date_expression ) ส่งคืนหมายเลขเดือน (1-12) จาก "date_expression" patindex ( string_expression1 , string_expression2 [ using {bytes|chars|characters} ] ) ส่งคืนจำนวนเต็มที่แทนตำแหน่งเริ่มต้นของ "string_expression1" แรกที่ปรากฏใน "string_expression2" หรือส่งคืน 0 ถ้าไม่พบ "string_expression1" โดยดีฟอลต์ patindex จะส่งคืนออฟเซ็ตเป็นอักขระ ออฟเซ็ตสามารถส่งคืนเป็นไบต์โดยการตั้งค่าชนิดของการส่งคืนเป็นไบต์ อักขระไวด์การ์ด % ต้องนำหน้าและต่อจากรูปแบบใน "string_expression1" ยกเว้นเมื่อค้นหาอักขระแรกหรืออักขระสุดท้าย rand ( integer_expression ) ส่งคืนค่า float แบบสุ่มระหว่าง 0 และ 1 โดยใช้อ็อพชัน "integer_expression" เป็นค่า seed replicate ( string_expression , integer_expression ) ส่งคืนสตริงที่ประกอบด้วย "string_expression" ซ้ำ "integer_expression" ครั้ง reverse ( string_expression ) ส่งคืนส่วนกลับของ "string_expression" right ( string_expression , integer_expression ) ส่งคืน "integer_expression" อักขระที่อยู่ขวาสุดของ "string_expression" round ( numeric_expression, integer_expression ) ส่งคืน "numeric_expression" ที่ปัดเศษเป็นค่าที่ใกล้เคียงกับ "integer_expression" ตำแหน่งทางขวาของจุดทศนิยมที่สุด การปัดเศษจะเกิดขึ้นก่อนการใช้การจัดรูปแบบข้อมูล ตัวอย่าง: round (125, -1) ผลลัพธ์: 130 rtrim ( string_expression ) ส่งคืน "string_expression" ที่ตัดช่องว่างที่ต่อท้ายออก ตัวอย่าง: rtrim ( [Sales (query)].[Sales staff].[Last name] ) ผลลัพธ์: ส่งคืนนามสกุลที่ลบช่องว่างใดๆ ที่อยู่ท้ายชื่อออก soundex ( string_expression ) ส่งคืนโค้ด soundex สี่อักขระสำหรับสตริงอักขระที่รวมเป็นลำดับที่ติดกันของตัวอักษรโรมันไบต์เดียวหรือสองไบต์ที่ถูกต้อง space ( integer_expression ) ส่งคืนสตริงที่มีระยะห่างไบต์เดียว "integer_expression" str ( numeric_expression [ , integer_expression1 [ , integer_expression2 ] ] ) ส่งคืนสตริงที่แทน "numeric_expression" "Integer_expression1" เป็นความยาวของสตริงที่ส่งคืนและมีค่าติดตั้งดีฟอลต์เป็น 10 "Integer_expression2" เป็นจำนวนของหลักทศนิยมและมีค่าติดตั้งดีฟอลต์เป็น 0 โดยเป็นอ็อพชันทั้งคู่ stuff ( string_expression1 , integer_expression1 , integer_expression2 , string_expression2 ) ลบ "integer_expression2" อักขระจาก "string_expression1" ที่เริ่มต้นที่ "integer_expression1" และแทรก "string_expression2" ลงใน "string_expression1" ที่ตำแหน่งนั้น เมื่อต้องการลบอักขระโดยไม่แทรกอักขระอื่น "string_expression2" ควรเป็น null และไม่ใช่ " " ซึ่งหมายถึงช่องว่างเดียว substring ( string_expression , integer_expression1 , integer_expression2 ) ส่งคืนสตริงย่อยของ "string_expression" ที่เริ่มต้นที่ตำแหน่ง "integer_expression1" "Integer_expression2" ระบุจำนวนของอักขระในสตริงย่อย ตัวอย่าง: substring ( [Sales (query)].[Sales staff].[Position code], 3 , 5 ) ผลลัพธ์: ส่งคืนอักขระ 3 ถึง 7 ของรหัสตำแหน่ง to_unichar ( integer_expression ) ส่งคืนนิพจน์ unichar ที่มีค่า "integer_expression" ถ้า "integer_expression" อยู่ในช่วง 0xD800..0xDFFF การดำเนินการจะถูกยกเลิก ถ้า "integer_expression" อยู่ในช่วง 0..0xFFFF จะส่งคืนค่า Unicode เดียว ถ้า "integer_expression" อยู่ในช่วง 0x10000..0x10FFFF จะส่งคืนคู่ของ surrogate uhighsurr ( string_expression , integer_expression ) ส่งคืน 1 ถ้าค่า Unicode ที่ "integer_expression" สูงกว่าครึ่งหนึ่งของคู่ surrogate (ซึ่งควรปรากฏครั้งแรกในคู่) ไม่เช่นนั้น จะส่งคืน 0 ฟังก์ชันนี้อนุญาตให้คุณเขียนโค้ดที่จัดเจนสำหรับการจัดการ surrogate โดยเฉพาะอย่างยิ่ง ถ้าสตริงย่อยเริ่มต้นบนอักขระ Unicode โดยที่ uhighsurr () เป็น true จะดึงสตริงย่อยของค่า Unicode อย่างน้อยสองค่า เนื่องจาก substr() จะไม่ดึงเพียง 1 ค่า Substr () จะไม่ดึงครึ่งของคู่ surrogate ulowsurr ( string_expression , integer_expression ) ส่งคืน 1 ถ้าค่า Unicode ที่ "integer_expression" น้อยกว่าครึ่งหนึ่งของคู่ surrogate (ซึ่งควรปรากฏครั้งที่สองในคู่) ไม่เช่นนั้น จะส่งคืน 0 ฟังก์ชันนี้อนุญาตให้คุณเขียนโค้ดที่ชัดเจนรอบๆ การปรับที่ดำเนินการโดย substr (), stuff () และ right () โดยเฉพาะอย่างยิ่ง ถ้าสตริงย่อยที่สิ้นสุดบนค่า Unicode โดยที่ ulowsurr () เป็น true จะดึงสตริงย่อยอักขระที่น้อยกว่า 1 (หรือมากกว่า 1) เนื่องจาก substr () จะไม่ดึงสตริงที่มีคู่ของ surrogate ที่ไม่ตรงกัน uscalar ( string_expression ) ส่งคืนค่า Unicode scalar สำหรับอักขระ Unicode แรกใน "string_expression" ถ้าอักขระแรกไม่ใช่ครึ่งที่มีลำดับสูงของคู่ surrogate ดังนั้น ค่าจะอยู่ในช่วง 0..0xFFFF ถ้าอักขระแรกเป็นครึ่งลำดับสูงของคู่ surrogate ค่าที่สองต้องเป็นครึ่งลำดับต่ำ และส่งที่คืนค่าจะอยู่ในช่วง 0x10000..0x10FFFF ถ้าฟังก์ชันนี้ถูกเรียกใช้บนนิพจน์อักขระ Unicode บนครึ่งของ surrogate ที่ไม่ตรงกัน การดำเนินการจะถูกยกเลิก year ( date_expression ) ส่งคืนปีจาก date_expression
Sybase Math log ( numeric_expression ) ส่งคืนลอการิทึมธรรมชาติของ "numeric_expression" log10 ( numeric_expression ) ส่งคืนลอกาลิทึมฐานสิบของ "numeric_expression" pi () ส่งคืนค่าคงที่ของ pi เป็นค่า floating point sign ( numeric_expression ) ส่งคืนตัวบ่งชี้ที่แสดงเครื่องหมายของ "numeric_expression": +1 ถ้า "numeric_expression" เป็นบวก 0 ถ้า "numeric_expression" เป็นศูนย์ หรือ -1 ถ้า "numeric_expression" เป็นลบ
Sybase Trigonometry acos ( numeric_expression ) ส่งคืน arccosine ของ "numeric_expression" เป็นเรเดียน arccosine เป็นมุมที่มีค่า cosine เป็น "numeric_expression" asin ( numeric_expression ) ส่งคืน arcsine ของ "numeric_expression" เป็นเรเดียน arcsine เป็นมุมที่มีค่า sine เป็น "numeric_expression" atan ( numeric_expression ) ส่งคืน arctangent ของ "numeric_expression" เป็นเรเดียน arctangent เป็นมุมที่มีค่า tangent เป็น "numeric_expression" atn2 ( numeric_expression1, numeric_expression2 ) ส่งคืนมุม เป็นเรเดียน ที่ tangent เป็น "numeric_expression1" / "numeric_expression2" cos ( numeric_expression ) ส่งคืน cosine ของ "numeric_expression" โดยที่ "numeric_expression" เป็นมุมที่แสดงเป็นเรเดียน cot ( numeric_expression ) ส่งคืน cotangent ของ "numeric_expression" โดยที่ "numeric_expression" เป็นมุมที่แสดงเป็นเรเดียน degrees ( numeric_expression ) ส่งคืน "numeric_expression" เรเดียนที่แปลงเป็นองศา radians ( numeric_expression ) ส่งคืนองศาที่เทียบเท่ากับ "numeric_expression" ผลลัพธ์จะเป็นชนิดเดียวกันกับ "numeric_expression" สำหรับนิพจน์ตัวเลขหรือทศนิยม ผลลัพธ์มีความแม่นยำภายใน 77 และสเกลเท่ากับ "numeric_expression" เมื่อใช้ชนิดข้อมูลหน่วยความจำ การแปลงภายในเป็น float อาจทำให้ความแม่นยำหายไปบ้าง sin ( numeric_expression ) ส่งคืน sine ของ "numeric_expression" โดยที่ "numeric_expression" เป็นมุมที่แสดงเป็นเรเดียน tan ( numeric_expression ) ส่งคืน tangent ของ "numeric_expression" โดยที่ "numeric_expression" เป็นมุมที่แสดงเป็นเรเดียน