Teradata Extract Function Syntax and Example

The extract function in Teradata extracts date or time part of the date, time, timestamp, or interval fields. The extract function retrieves the sub part such as day, month, year, etc. This extract function is equivalent to date_part() function in other relational databases. In this article, we will check how to use an extract function to get specified subpart. The extract function also converts the extracted value exact numeric format. The output is always a numeric value. Teradata Extract Function In a data warehouse, you will be working with many…

Continue ReadingTeradata Extract Function Syntax and Example
Comments Off on Teradata Extract Function Syntax and Example

BigQuery Recursive Query Alternative – Example

You can use recursive query to identify the hierarchies of data, such as an organizational structure, employee-manager, bill-of-materials, and document hierarchy. Many relational databases such as Teradata, Oracle, etc. supports recursive queries, but Google BigQuery does not support all features. One of such features is Recursive CTE or VIEWS. Google BigQuery does not support either WITH RECURSIVE Clause or using the RECURSIVE Clause in a CREATE VIEW Statement. In this article, we will check Google BigQuery Recursive Query Alternative with an working example. BigQuery Recursive Query Alternative As mentioned earlier,…

Continue ReadingBigQuery Recursive Query Alternative – Example
Comments Off on BigQuery Recursive Query Alternative – Example

Redshift TO_NUMBER Function and Different Arguments

There are many situations where you need to pre-process the received data in order to store it in the data warehouse. For instance, you many receive currency data with currency symbol. You have pre-process currency column to remove the dollar ($) symbol and store clean value in the database. Amazon Redshift support TO_NUMBER function, you can use it to remove unwanted characters from numeric value. In this article, we will check how to use TO_NUMBER type conversion function with its different format. We will also check different examples to use…

Continue ReadingRedshift TO_NUMBER Function and Different Arguments
Comments Off on Redshift TO_NUMBER Function and Different Arguments

Redshift Trunc and Date_Trunc Functions, Examples and Differences

Amazon Redshift supports many built-in functions that you can use to perform day to day activities such as extracting only date part from a timestamp value. Redshift provides many date and string functions that you can use to play around date type. In this article, we will check how to use an Amazon Redshift trunc and date_trunc functions, syntax, usage, examples and difference between these two functions. Redshift Trunc and Date_Trunc Functions You can use the trunc and date_trunc functions to trunc certain portions of the date type. However, you…

Continue ReadingRedshift Trunc and Date_Trunc Functions, Examples and Differences
Comments Off on Redshift Trunc and Date_Trunc Functions, Examples and Differences

How to Remove Newline Characters from String in Snowflake?

If you store a string as a variable or a column in relational databases such SQL Server , then it can contain line breaks or newline (\n) characters. But, these newline characters have to be removed in pre-processing steps. In this article, we will check how to remove newline characters from a string or text in Snowflake. Remove Newline Characters from String in Snowflake Removing newline (\n), carriage return (\r) or any special characters is the common pre-processing step before storing records in any relational databases. Many databases supports built-in…

Continue ReadingHow to Remove Newline Characters from String in Snowflake?
Comments Off on How to Remove Newline Characters from String in Snowflake?

What is isnull Alternative in Teradata SQL?

The relational databases such as SQL server supports isnull function. It returns the alternate value if input argument or expression is null. But, Teradata does not support isnull function. Instead, you have to use an alternate method to replace null values. In this article, we will check what is isnull alternative in Teradata SQL with some examples. isnull Function Alternative in Teradata SQL As mentioned earlier, Teradata does not support isnull function. There are many alternative methods that you can use as an alternative to isnull function. The SQL Server ISNULL() function…

Continue ReadingWhat is isnull Alternative in Teradata SQL?
Comments Off on What is isnull Alternative in Teradata SQL?

How to Remove Spaces in the String in snowflake?

In a data warehouse, you will receive data from multiple sources. You may have to pre-process the data before loading it to target table. The pre-process step such as removing white spaces from data is commonly used. In this article, we will check how to remove spaces in a string using Snowflake built-in functions. Remove Spaces in a String in snowflake Nowadays, data is required everywhere. Many organizations automatically capture the data using tools or machines. Machines may introduce the unwanted data such as white space when it captures the…

Continue ReadingHow to Remove Spaces in the String in snowflake?
Comments Off on How to Remove Spaces in the String in snowflake?

What is Dateadd Function Alternative in Teradata SQL?

In ANSI SQL, Dateadd function adds the specified value for the specified date or time part to a date, time, or timestamp. However, the same function is not available in Teradata. In this article, we will check what is Dateadd function alternative in Teradata SQL, methods and examples. Dateadd Function Alternative in Teradata SQL Many relational databases and data warehouse appliances such as Snowflake, SQL Server, Netezza, Oracle, etc support date add function to add or subtract days, months, years, hours, minutes, and seconds to date or timestamp value. For…

Continue ReadingWhat is Dateadd Function Alternative in Teradata SQL?
Comments Off on What is Dateadd Function Alternative in Teradata SQL?

Convert Unix epoch time into Snowflake Date

Many relational databases such as PostgreSQL support functions to convert Unix epoch time into a date or timestamp value. But, there are no built-in functions available in Snowflake that you can use to convert epoch time. You will have to use an alternate approach to convert epoch format. In this article, we will check how to convert Unix epoch time into the Snowflake date with some examples. Convert Unix epoch time into Snowflake Date The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of seconds that have elapsed since January 1,…

Continue ReadingConvert Unix epoch time into Snowflake Date
Comments Off on Convert Unix epoch time into Snowflake Date

Convert Unix epoch time into Redshift timestamps

Many relational databases such as Snowflake, PostgreSQL support functions to convert Unix epoch time into timestamp value. But, Redshift does not support these unix to timestamp functions. You will have to use an alternate approach to convert epoch format. In this article, we will check how to convert unix epoch time into Redshift timestamps with some examples. Convert Unix epoch time into Redshift timestamps The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of seconds that have elapsed since January 1, 1970. Amazon Redshift does not provide specific functions to convert…

Continue ReadingConvert Unix epoch time into Redshift timestamps
Comments Off on Convert Unix epoch time into Redshift timestamps