Teradata isnumeric Function Alternatives and Examples

Teradata is one of the widely used MPP databases. It can be used to combine many data sources. When you work with heterogeneous data set, you may have to get rid of many unwanted characters such as $ in your price column. If your application requirement is of numeric type, you may get requirement to filter out non-numeric values. In this article, we will check Teradata isnumeric function alternatives with some examples. We will also see how to check if string is numeric with an example. Teradata isnumeric Function The…

Continue ReadingTeradata isnumeric Function Alternatives and Examples
Comments Off on Teradata isnumeric Function Alternatives and Examples

Teradata Joins, Syntax and Examples

Just like Teradata set operators, you can combine records from multiples tables using Teradata joins. Teradata join syntax is similar to other database SQL joins. You can execute SQL queries with different join types on Teradata machine with little or without any change. There are many advantages of using SQL joins, for example, combine columns from multiples tables, update tables using joins. The best way to understand the Teradata joins is to get to know the SQL joins and then consider the join strategies that is used by Teradata database…

Continue ReadingTeradata Joins, Syntax and Examples
Comments Off on Teradata Joins, Syntax and Examples

Teradata NVL and NVL2 Function, Syntax and Examples

The Teradata is one of the widely used MPP relational database systems. Most of the organizations are using Teradata for their high-performance servers such as analytics, back-end systems for reporting servers, etc. Teradata is used with many heterogeneous data sources, you may get lots of junk and null values. You should have a mechanism to deal with such a data. In this article, we will check such a null handling functions. i.e. Teradata NVL function, and NVL2 functions with some examples. Teradata NVL Function  Teradata NVL functions replaces a NULL…

Continue ReadingTeradata NVL and NVL2 Function, Syntax and Examples
Comments Off on Teradata NVL and NVL2 Function, Syntax and Examples

Steps to Connect Teradata Database from Spark – Examples

Apache Spark is one of the emerging bigdata technology, thanks to its fast and in memory distributed computation. You can analyze petabytes of data using the Apache Spark in memory distributed computation. You can connect Spark to all major databases in market such as Netezza, Oracle, etc. In this article, we will check one of methods to connect Teradata database from Spark program. You can connect using either Scala or Python Pyspark. For all examples in this article, we will use Scala to read Teradata tables. You can even execute…

Continue ReadingSteps to Connect Teradata Database from Spark – Examples
Comments Off on Steps to Connect Teradata Database from Spark – Examples

Teradata WITH Clause Syntax, Usage and Examples

Teradata WITH Clause is an optional clause that always precedes SELECT clause in the query statements. Each subquery in the WITH clause specifies a table name, an optional list of column names, and a query expression that evaluates to a table (usually a SELECT statement). In SQL, WITH clause are commonly referred to as Common Table Expressions (CTE). Teradata WITH Clause WITH clause is used for many purposes, if you want to find our hierarchy in the data then recursive WITH clause is used. If your requirement is to reuse…

Continue ReadingTeradata WITH Clause Syntax, Usage and Examples
Comments Off on Teradata WITH Clause Syntax, Usage and Examples

Teradata Split Delimited Fields into Table Records and Examples

If you are working on the huge amount of different source system then you may come across the requirement of Teradata split delimited fields into table records. You can perform Teradata split delimited string into columns in various ways using Teradata built-in string functions or Teradata regular expressions. You can use any of the below methods as per your requirements: Teradata Split Delimited fields using STRTOK_SPLIT_TO_TABLE Function  Since TD14, there is a STRTOK_SPLIT_TO_TABLE function. You can use this function to split your string or delimited field into table columns. Teradata…

Continue ReadingTeradata Split Delimited Fields into Table Records and Examples
Comments Off on Teradata Split Delimited Fields into Table Records and Examples

Teradata Regular Expressions and Examples

The Teradata regular expressions functions identify precise patterns of characters and are useful for extracting string from the data and validation of the existing data, for example, validate date, range checks, checks for characters, and extract specific characters from the data. In this article, we will check some of commonly used Teradata regular expressions. Read: Teradata String Functions and Examples Commonly used Teradata date functions and Examples Teradata Substring Regular Expression - REGEXP_SUBSTR This function is used to extracts a substring from source_string that matches a regular expression specified by…

Continue ReadingTeradata Regular Expressions and Examples
Comments Off on Teradata Regular Expressions and Examples

Teradata String Functions and Examples

Teradata String Functions are primarily used for various string manipulation. It also supports most of the standard string function along with the Teradata extension to those functions. Teradata String Functions Below are the commonly used Teradata string functions: Read: Teradata Regular Expressions and Examples Teradata Set Operators: UNION, UNION ALL, INTERSECT, EXCEPT/MINUS Commonly used Teradata Analytics Functions and Examples Teradata Date Functions and Examples Function Description concat(string1, ..., stringN) Returns the concatenation of two or more string values. This function provides the same functionality as the SQL-standard concatenation operator (||). length(string) Returns…

Continue ReadingTeradata String Functions and Examples
2 Comments

Teradata Set Operators: UNION, UNION ALL, INTERSECT, EXCEPT/MINUS

You can use the Teradata set operators to combine similar data sets from two or more SELECT statements in the query. The data types of the columns which are being used in the Teradata SET operators should match or explicitly type cast column values to required data types. The SET operators are similar to the JOINs, the only difference is that join combines the columns from different tables whereas SET operators combine rows from different tables. Read: Teradata String Functions and Examples Commonly used Teradata Date Functions and Examples Teradata…

Continue ReadingTeradata Set Operators: UNION, UNION ALL, INTERSECT, EXCEPT/MINUS
Comments Off on Teradata Set Operators: UNION, UNION ALL, INTERSECT, EXCEPT/MINUS

Commonly used Teradata Date Functions and Examples

This article is about detailed descriptions and examples of the commonly used Teradata date functions that you can use to manipulate date columns in the Teradata, stored procedure or in embedded SQLs. In the real word scenario, many application manipulate the date and time data types. Date types are highly formatted and very complicated. Each date value contains the century, year, month, day, hour, minute, and second. Each RDBMS may employ different date functions, and there may also be differences in the syntax for each RDBMS even when the function…

Continue ReadingCommonly used Teradata Date Functions and Examples
Comments Off on Commonly used Teradata Date Functions and Examples