Example: air traffic controller

SQL Functions, Operators, Expressions, and …

Teradata DatabaseSQL functions , Operators, Expressions, and PredicatesRelease 2009 The product or products described in this book are licensed products of Teradata Corporation or its , BYNET, DBC/1012, DecisionCast, DecisionFlow, DecisionPoint, Eye logo design, InfoWise, Meta Warehouse, MyCommerce, SeeChain, SeeCommerce, SeeRisk, Teradata Decision Experts, Teradata Source Experts, WebAnalyst, and You ve Never Seen Your Business Like This Before are trademarks or registered trademarks of Teradata Corporation or its and SCSIS elect are trademarks or registered trademarks of Adaptec, Opteron and Opteron are trademarks of Advanced Micro Devices, and NetVault are trademarks or registered trademarks of BakBone Software, , PowerPath, SRDF, and Symmetrix are registered trademarks of EMC is a trademark of GoldenGate Software, and HP are registered trademarks of Hewlett-Packard , Pentium, and XEON are registered trademarks of Intel , CICS, RACF, Tivoli, and z/OS are registered trademarks of International Business Machines is a registered trademark of Linus and Engenio are registered trademarks of LSI , A

SQL Functions, Operators, Expressions, and Predicates 3 Preface Purpose SQL Functions, Operators, Expressions, and Predicates describes the functions, operators, expressions, and predicates of Teradata SQL.

Tags:

  Operator, Predicates, Functions, Expression, Sql functions, And predicates

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of SQL Functions, Operators, Expressions, and …

1 Teradata DatabaseSQL functions , Operators, Expressions, and PredicatesRelease 2009 The product or products described in this book are licensed products of Teradata Corporation or its , BYNET, DBC/1012, DecisionCast, DecisionFlow, DecisionPoint, Eye logo design, InfoWise, Meta Warehouse, MyCommerce, SeeChain, SeeCommerce, SeeRisk, Teradata Decision Experts, Teradata Source Experts, WebAnalyst, and You ve Never Seen Your Business Like This Before are trademarks or registered trademarks of Teradata Corporation or its and SCSIS elect are trademarks or registered trademarks of Adaptec, Opteron and Opteron are trademarks of Advanced Micro Devices, and NetVault are trademarks or registered trademarks of BakBone Software, , PowerPath, SRDF, and Symmetrix are registered trademarks of EMC is a trademark of GoldenGate Software, and HP are registered trademarks of Hewlett-Packard , Pentium, and XEON are registered trademarks of Intel , CICS, RACF, Tivoli, and z/OS are registered trademarks of International Business Machines is a registered trademark of Linus and Engenio are registered trademarks of LSI , Active Directory, Windows, Windows NT, and Windows Server are registered trademarks of Microsoft Corporation in the United States and other and SUSE are registered trademarks of Novell, Inc.

2 , in the United States and other and SANbox are trademarks or registered trademarks of QLogic and SAS/C are trademarks or registered trademarks of SAS Institute is a registered trademark of SPARC International, Microsystems, Solaris, Sun, and Sun Java are trademarks or registered trademarks of Sun Microsystems, Inc., in the United States and other , NetBackup, and VERITAS are trademarks or registered trademarks of Symantec Corporation or its affiliates in the United States and other is a collective membership mark and a service mark of Unicode, is a registered trademark of The Open Group in the United States and other product and company names mentioned herein may be the trademarks of their respective INFORMATION CONTAINED IN THIS DOCUMENT IS PROVIDED ON AN AS-IS BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.

3 SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO THE ABOVE EXCLUSION MAY NOT APPLY TO YOU. IN NO EVENT WILL TERADATA CORPORATION BE LIABLE FOR ANY INDIRECT, DIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS OR LOST SAVINGS, EVEN IF EXPRESSLY ADVISED OF THE POSSIBILITY OF SUCH information contained in this document may contain references or cross-references to features, functions , products, or services that are not announced or available in your country. Such references do not imply that Teradata Corporation intends to announce such features, functions , products, or services in your country. Please consult your local Teradata Corporation representative for those features, functions , products, or services available in your contained in this document may contain technical inaccuracies or typographical errors.

4 Information may be changed or updated without notice. Teradata Corporation may also make improvements or changes in the products or services described in this information at any time without maintain the quality of our products and services, we would like your comments on the accuracy, clarity, organization, and value of this document. Please e-mail: comments or materials (collectively referred to as Feedback ) sent to Teradata Corporation will be deemed non-confidential. Teradata Corporation will have no obligation of any kind with respect to Feedback and will be free to use, reproduce, disclose, exhibit, display, transform, create derivative works of, and distribute the Feedback and derivative works thereof without limitation on a royalty-free basis.

5 Further, Teradata Corporation will be free to use any ideas, concepts, know-how, or techniques contained in such Feedback for any purpose whatsoever, including developing, manufacturing, or marketing products or services incorporating 2000 2009 by Teradata Corporation. All Rights functions , Operators, Expressions, and Predicates3 PrefacePurposeSQL functions , Operators, Expressions, and predicates describes the functions , operators, expressions, and predicates of Teradata this book with the other books in the SQL book programmers and end users are the principal audience for this manual. System administrators, database administrators, security administrators, Teradata field engineers, and other technical personnel responsible for designing, maintaining, and using Teradata Database might also find this manual to be Software ReleaseThis book supports Teradata Database You should be familiar with basic relational database management technology and SQL.

6 This book is not an SQL you are not familiar with Teradata Database, read Introduction to Teradata before reading this information about developing applications using embedded SQL, see Te r a d a t a Preprocessor2 for Embedded SQL Programmer to This Book4 SQL functions , Operators, Expressions, and PredicatesChanges to This BookReleaseDescriptionTe r a d a t a Database 2009 Removed information not longer applicable to the documentation of the IN/NOT IN logical predicate. Clarified RESET WHEN example 3. Clarified the arguments to window aggregate functions . Clarified conversion to FLOAT, REAL, and DOUBLE PRECISION data types and truncation and rounding during r a d a t a Database 2009 Added the following: Clarification that UDT expressions cannot be used as input arguments to UDFs written in Java, and they cannot be used as IN and INOUT parameters of external stored procedures written in Java.

7 Restriction that the HASH BY or LOCAL ORDER BY clauses cannot be used in derived tables with set operators. Information about Period data types. Information about the CURRENT_USER and CURRENT_ROLE built-in functions . Information about the RESET WHEN clause. Information about the NEW VARIANT_TYPE expression for constructing dynamic UDTs. Additional information about implicit DateTime conversions. Clarification for determining the server character set of the result of a CASE expression . Information on calculating the interval difference between two DateTime values. A new chapter about UDF r a d a t a Database 2007 Added new rules to RANGE_N and CASE_N functions for multilevel PPI Modified TRANSLATE and TRANSLATE_CHK functions to support LOCALE as an option for the source or target repertoire name Documented the DEGREES, RADIANS, and STRING_CS functions Changed HASHBUCKET, HASHAMP, and HASHBAKAMP functions to reflect new value for the maximum number of hash buckets Added new character sets to the list of character sets in OCTET_LENGTH Added the following aggregate functions to the list of window aggregate functions in Chapter 8 that support the windowing specification.

8 CORR COVAR_POP COVAR_SAMP REGR_AVGX REGR_AVGY REGR_COUNT REGR_INTERCEPT REGR_R2 REGR_SLOPE REGR_SXX REGR_SXY REGR_SYY STDDEV_POP STDDEV_SAMP VA R _ P O P VA R _ S A M PPrefaceAdditional InformationSQL functions , Operators, Expressions, and Predicates5 Additional InformationTo maintain the quality of our products and services, we would like your comments on the accuracy, clarity, organization, and value of this document. Please e-mail: to Microsoft Windows and LinuxThis book refers to Microsoft Windows and Linux. For Teradata Database , these references mean: Windows is Microsoft Windows Server 2003 64-bit. Linux is SUSE Linux Enterprise Server 9 and SUSE Linux Enterprise Server the Teradata Information Products Publishing Library site to: View or download a manual:1 Under Online Publications, select General your search criteria and click Search.

9 Download a documentation CD-ROM:1 Under Online Publications, select General the Title or Keyword field, enter CD-ROM, and click Search. Order printed manuals:Under Print & CD Publications, select How to Teradata home page provides links to numerous sources of information about Teradata. Links include: Executive reports, case studies of customer experiences with Teradata, and thought leadership Technical information, solutions, and expert advice Press releases, mentions and media Teradata University Network fosters education on data warehousing, business intelligence (BI) and database administration (DBA).PrefaceReferences to Microsoft Windows and Linux6 SQL functions , Operators, Expressions, and PredicatesSQL functions , Operators, Expressions, and Predicates7 Table of ContentsPreface.

10 3 Purpose ..3 Audience ..3 Supported Software Release ..3 Prerequisites ..3 Changes to This Book ..4 Additional Information ..5 References to Microsoft Windows and Linux ..5 Chapter 1: Introduction.. 17 SQL functions .. 17 SQL Operators.. 18 SQL Expressions .. 19 SQL predicates .. 20 Chapter 2: CASE Expressions.. 23 CASE .. 23 Valued CASE expression .. 24 Searched CASE expression .. 27 Error Conditions .. 31 Rules for the CASE expression Result Type .. 32 Format for a CASE expression .. 37 CASE and Nulls .. 38 COALESCE expression .. 40 NULLIF expression .. 42 Table of Contents8 SQL functions , Operators, Expressions, and PredicatesChapter 3: Arithmetic Operators and functions / Trigonometric and Hyperbolic functions ..45 Arithmetic Operators.


Related search queries