Teradata
Teradata {account} ส่งคืนสตริงแอคเคาต์สำหรับผู้ใช้ปัจจุบัน add_months ( date_expression|datetime_expression , integer_expression ) ส่งคืนวันที่หรือวันที่เวลาที่เป็นผลลัพธ์จากการเพิ่ม "integer_expression" เดือนเข้ากับ "date_expression" หรือ "datetime_expression" bytes ( byte_expression ) ส่งคืนจำนวนของไบต์ที่อยู่ใน "byte_expression" "Byte_expression" ถูกจำกัดเป็น BYTE หรือ VARBYTE concat ( string_expression1 , string_expression2 ) ส่งคืนสตริงที่เป็นผลลัพธ์ของการรวม "string_expression1" กับ "string_expression2" ตัวอย่าง: concat ( [Sales (query)].[Sales staff].[First name], [Sales (query)].[Sales staff].[Last name] ) ผลลัพธ์: ส่งคืนชื่อและนามสกุล เช่น Bob Smith {database} ส่งคืนชื่อของฐานข้อมูลดีฟอลต์สำหรับผู้ใช้ปัจจุบัน {date} ส่งคืนวันที่ปัจจุบัน characters ( string_expression ) ส่งคืนค่าจำนวนเต็มที่แทนจำนวนของอักขระโลจิคัลหรือไบต์ที่อยู่ใน "string_expression" case_n ( condition_expression_list [ , NO CASE|UNKNOWN|NO CASE OR UNKNOWN [ , UNKNOWN ] ] ) ประเมิน "condition_expression_list" และส่งคืนตำแหน่งของเงื่อนไขแรกที่เป็น true ระบุว่าไม่มีเงื่อนไขก่อนหน้านี้ในรายการที่ประเมินว่าไม่รู้จัก คีย์เวิร์ดต้องอยู่ในวงเล็บปีกกา ไม่มี case ในเงื่อนไขที่เป็นอ็อพชันที่ประเมินเป็น true ถ้าทุกนิพจน์ในรายการประเมินเป็น false ไม่มี case หรือไม่รู้จักเป็นเงื่อนไขที่เป็นอ็อพชันที่ประเมินเป็น true ถ้าทุกนิพจน์ในรายการประเมินเป็น false หรือถ้านิพจน์ประเมินเป็นไม่รู้จักและเงื่อนไขก่อนหน้านี้ทั้งหมดในรายการประเมินเป็น false ไม่รู้จักเป็นเงื่อนไขที่เป็นอ็อพชันที่ประเมินเป็น true ถ้านิพจน์ประเมินเป็นไม่รู้จักและเงื่อนไขก่อนหน้านี้ทั้งหมดในรายการประเมินเป็น false char2hexint ( string_expression ) ส่งคืนเลขฐานสิบหกที่แทน "string_expression" coalesce coalesce ( expression_list ) ส่งคืนค่าของอาร์กิวเมนต์แรกที่ไม่ใช่ null ใน "expression_list" ฟังก์ชัน coalesce ต้องมีอย่างน้อยสองนิพจน์ ถ้าอาร์กิวเมนต์ทั้งหมดประเมินเป็น null จะส่งคืน null ตัวอย่าง: coalesce ( [Unit price], [Unit sale price] ) ผลลัพธ์: ส่งคืนราคาต่อหน่วย หรือราคาขายต่อหน่วยถ้าราคาต่อหน่วยเป็น null index ( string_expression1 , string_expression2 ) ส่งคืนตำแหน่งเริ่มต้นของ "string_expression2" ใน "string_expression1" ส่งคืนค่า 0 เมื่อไม่พบ "string_expression2" ใน "string_expression1" ส่งคืนค่า 1 เมื่อพบ "string_expression2" ที่ตำแหน่งแรกของ "string_expression1" index ( 'The black horse jumped over the black sheep.', 'black' ) ผลลัพธ์: 5 index ( 'The black horse jumped over the black sheep.', 'The' ) ผลลัพธ์: 1 index ( 'The black horse jumped over the black sheep.', 'green' ) ผลลัพธ์: 0 left ( string_expression , integer_expression ) ส่งคืน "integer_expression" อักขระที่อยู่ซ้ายสุดของ "string_expression" ตัวอย่าง: left ( [Sales (query)].[Sales staff].[Last name] , 3 ) ผลลัพธ์: ส่งคืนอักขระสามตัวแรกของแต่ละนามสกุล log ( numeric_expression ) คำนวณลอกาลิทึมฐาน 10 ของ "numeric_expression" "Numeric_expression" ต้องเป็นนิพจน์ตัวเลข ที่เป็นบวก ไม่ใช่ศูนย์ format ( expression ) ส่งคืนรูปแบบที่ประกาศไว้สำหรับ "expression" เป็นสตริงอักขระตัวแปรที่ยาวได้ถึง 30 อักขระ month ( date_expression ) ส่งคืนส่วนของเดือนของ "date_expression" nullif ( scalar_expression1 , scalar_expression2 ) ส่งคืนค่า null ถ้า "scalar_expression1" และ "scalar_expression2" เท่ากัน ไม่เช่นนั้น จะส่งคืน "scalar_expression1" "Scalar_expression1" และ "scalar_expression2" สามารถเป็นชนิดข้อมูลใดๆ nullifzero ( numeric_expression ) ถ้า "numeric_expression" เป็นศูนย์ จะแปลงเป็น null เพื่อหลีกเลี่ยงการหารด้วยศูนย์ {profile} ส่งคืนโปรไฟล์ปัจจุบันสำหรับเซสชันหรือเป็น null ถ้าไม่มี random ( lower_bound , upper_bound ) ส่งคืนเลขจำนวนเต็มแบบสุ่มสำหรับแต่ละแถวของตารางผลลัพธ์ "Lower_bound" และ "upper_bound" เป็นค่าคงที่จำนวนเต็ม ขีดจำกัดสำหรับ "lower_bound" และ "upper_bound" มีช่วงจาก -2147483648 ถึง 2147483647 "Upper_bound" ต้องมากกว่าหรือเท่ากับ "lower_bound" range_n ( test_expression between start_expression|start_expression_list|* and end_expression|* [ each range_size [ , no range [ or unknown|, unknown ]|unknown ] ] ) ประเมิน "test_expression" แม็พผลลัพธ์กับรายการของช่วงที่ระบุ และส่งคืนตำแหน่งของช่วงในรายการ "Start_expression" และ "end_expression" เป็นนิพจน์ค่าคงที่และต้องเป็นชนิดข้อมูลเดียวกันกับ "test_expression" ใช้เครื่องหมายดอกจัน (*) เพื่อทำเครื่องหมายขอบเขตเริ่มต้นของช่วงแรกและระบุค่าที่น้อยที่สุดที่เป็นไปได้ เครื่องหมายดอกจันยังใช้เพื่อทำเครื่องหมายสิ้นสุดขอบเขตของช่วงสุดท้ายและระบุค่าสูงสุดที่เป็นไปได้ เครื่องหมายดอกจันใช้ได้กับชนิดข้อมูลใด ๆ "Range_size" เป็นค่าคงที่หรือนิพจน์ค่าคงที่ ช่วงที่ระบุแต่ละวลีเทียบเท่ากับชุดของช่วง ค่าของ "range_size" ต้องมากกว่าศูนย์ ไม่มีช่วงเป็นช่วงที่เป็นอ็อพชันเพื่อจัดการกับ "test_expression" ที่ไม่ได้แม็พกับช่วงใด ๆ ที่ระบุ ไม่มีช่วงหรือไม่รู้จักเป็นอ็อพชันที่จัดการกับ "test_expression" ที่ไม่ได้แม็พกับช่วงใด ๆ ที่ระบุ หรือ "test_expression" ที่ประเมินเป็นค่า null เมื่อ range_n ไม่ได้ระบุช่วงระหว่าง * และ *. ไม่รู้จักเป็นอ็อพชันที่จัดการกับ "test_expression" ที่ประเมินเป็นค่า null เมื่อ range_n ไม่ได้ระบุช่วงระหว่าง * และ *. {role} ส่งคืนโปรบทบาทปัจจุบันสำหรับเซสชันหรือเป็น null ถ้าไม่มี {session} ส่งคืนจำนวนของเซสชันสำหรับผู้ใช้ปัจจุบัน soundex ( string_expression ) ส่งคืนสตริงอักขระที่แทนโค้ด Soundex สำหรับ "string_expression" substr ( string_expression , integer_expression1 [ , integer_expression2 ] ) ส่งคืนสตริงย่อยของ "string_expression" ที่เริ่มต้นที่ตำแหน่ง "integer_expression1" สำหรับ "integer_expression2" อักขระ อักขระแรกใน "string_expression" อยู่ที่ตำแหน่ง 1 ถ้าตัด "integer_expression2" ออก ส่งคืนสตริงย่อยของ "string_expression" ที่เริ่มต้นที่ตำแหน่ง "integer_expression1" และสิ้นสุดที่ท้ายของ "string_expression" ตัวอย่าง: substr ( [Sales (query)].[Sales staff].[Position code], 3 , 5 ) ผลลัพธ์: ส่งคืนอักขระ 3 ถึง 7 ของรหัสตำแหน่ง {time} ส่งคืนเวลาปัจจุบันโดยใช้วัน 24 ชั่วโมง ตามเอกสาร Teradata เลิกใช้ฟังก์ชันระบบ TIME แล้ว ใช้ฟังก์ชัน CURRENT_TIME แทน โปรดสังเกตว่า ใน Compatible Mode TIME จะส่งคืนชนิดข้อมูล time ขณะเวลา Dynamic Query Mode จะส่งคืนค่าของชนิด FLOAT type ( expression ) ส่งคืนชนิดข้อมูลที่กำหนดไว้สำหรับ "expression" {user} ส่งคืนชื่อผู้ใช้ของผู้ใช้ปัจจุบัน vargraphic ( string_expression ) ส่งคืนสตริงอักขระที่แทนโค้ด vargraphic สำหรับ "string_expression" year ( date_expression ) ส่งคืนตำแหน่งปีของ "date_expression" zeroifnull ( numeric_expression ) แปลงข้อมูลจาก null เป็น 0 เพื่อหลีกเลี่ยงข้อผิดพลาดที่เกิดขึ้นจากค่า null ถ้า "numeric_expression" ไม่ใช่ null จะส่งคืนค่าของ "numeric_expression" ถ้า "numeric_expression" เป็นสตริงอักขระ จะถูกแปลงเป็นค่าตัวเลขของชนิดข้อมูล float ถ้า "numeric_expression" เป็นค่า null หรือศูนย์ จะส่งคืนค่าศูนย์
Teradata Trigonometry acos ( numeric_expression ) ส่งคืน arccosine ของ "numeric_expression" เป็นเรเดียน arccosine เป็นมุมที่มีค่า cosine เป็น "numeric_expression" "Numeric_expression" ต้องอยู่ระหว่าง -1 และ 1 acosh ( numeric_expression ) ส่งคืน inverse hyperbolic cosine ของ "numeric_expression" โดยที่ "numeric_expression" สามารถเป็นตัวเลข real ที่เท่ากับหรือเท่ากับ 1 asinh ( numeric_expression ) ส่งคืน inverse hyperbolic sine ของ "numeric_expression" โดยที่ "numeric_expression" สามารถเป็นตัวเลข real asin ( numeric_expression ) ส่งคืน arcsine ของ "numeric_expression" เป็นเรเดียน arcsine เป็นมุมที่มีค่า sine เป็น "numeric_expression" "Numeric_expression" ต้องอยู่ระหว่าง -1 และ 1 atan ( numeric_expression ) ส่งคืน arctangent ของ "numeric_expression" เป็นเรเดียนโดยที่ arctangent เป็นมุมที่มี tangent เป็น "numeric_expression" atan2 ( numeric_expression1, numeric_expression2 ) ส่งคืน arctangent ของจุดตัด x และ y ที่ระบุโดย "numeric_expression1" และ "numeric_expression2" ตามลำดับ เป็นเรเดียน มุมที่ส่งคืนจะอยู่ระหว่าง - และ π เรเดียน ไม่รวม π atanh ( numeric_expression ) ส่งคืน inverse hyperbolic tangent ของ "numeric_expression" โดยที่ "numeric_expression" สามารถเป็นตัวเลข real ระหว่าง 1 และ -1 ไม่รวม 1 และ -1 cos ( numeric_expression ) ส่งคืน cosine ของ "numeric_expression" โดยที่ "numeric_expression" เป็นมุมที่แสดงเป็นเรเดียน cosh ( numeric_expression ) ส่งคืน hyperbolic cosine ของ "numeric_expression" โดยที่ "numeric_expression" สามารถเป็นตัวเลข real sinh ( numeric_expression ) ส่งคืน hyperbolic sine ของ "numeric_expression" โดยที่ "numeric_expression" สามารถเป็นตัวเลข real sin ( numeric_expression ) ส่งคืน sine ของ "numeric_expression" โดยที่ "numeric_expression" เป็นมุมที่แสดงเป็นเรเดียน tan ( numeric_expression ) ส่งคืน tangent ของ "numeric_expression" โดยที่ "numeric_expression" เป็นมุมที่แสดงเป็นเรเดียน tanh ( numeric_expression ) ส่งคืน hyperbolic tangent ของ "numeric_expression" โดยที่ "numeric_expression" สามารถเป็นตัวเลข real