Teradata Number Date Alternative in Redshift

The relational database such as Teradata supports numeric dates. For example, 851231 is a valid representation for date '1985-12-31'. These types of Teradata integer date formats are not yet supported in Amazon Redshift. In this article, we will check what is Teradata number date alternative in AWS Redshift. Teradata Number Date Values There are many Teradata features that are not yet available in any other Relational or databases. One of such features is Teradata number date values. Teradata Database stores each DATE value as a four-byte integer using the following…

Continue ReadingTeradata Number Date Alternative in Redshift
Comments Off on Teradata Number Date Alternative in Redshift

Redshift SELECT INTO Variable – Example

The relational database that supports procedural language allows you to assign a value to local variable using SELECT statement within stored procedures. The databases such as Teradata, Oracle supports SELECT INTO clause to assign a value to a local variable. In this article, we will check how to assign a subquery value to a local variable using Redshift SELECT INTO clause within Stored Procedures. Redshift SELECT INTO Variable The SELECT INTO statement in Redshift retrieves data from one or more database tables, and assigns the selected values to variables. You can use SELECT…

Continue ReadingRedshift SELECT INTO Variable – Example
Comments Off on Redshift SELECT INTO Variable – Example

What is ENDS_WITH Function Alternative in Redshift?

The relational databases such as Oracle and cloud databases such as BigQuery, Snowflake supports ends with function. The function name may be different, but the functionality is same. For example, Oracle and BigQuery provides ENDS_WITH function and Snowflake contains ENDSWITH function. The Amazon Redshift does not provide ENDS_WITH function. In my other article, What is STARTS_WITH Function Alternative in Redshift, we have seen starts_with alternative in Redshift. In this article, we will check what is ENDS_WITH function alternative in AWS Redshift? ENDS_WITH Function In Redshift Not all the string functions…

Continue ReadingWhat is ENDS_WITH Function Alternative in Redshift?
Comments Off on What is ENDS_WITH Function Alternative in Redshift?

What is STARTS_WITH Function Alternative in Redshift?

The relational databases such as Oracle and cloud databases such as BigQuery, Snowflake supports starts with function. The function name may be different, but the functionality is same. For example, Oracle and BigQuery provides STARTS_WITH function and Snowflake contains STARTSWITH function. The Amazon Redshift does not provide STARTS_WITH function. In my other article, What is ENDS_WITH Function Alternative in Redshift, we have seen ends_with alternative in Redshift. In this article, we will check what is STARTS_WITH function alternative in AWS Redshift? STARTS_WITH Function In Redshift Not all the string functions…

Continue ReadingWhat is STARTS_WITH Function Alternative in Redshift?
Comments Off on What is STARTS_WITH Function Alternative in Redshift?

Redshift Nested Window Functions and Examples

Amazon Redshift cloud data warehouse supports many useful windows or analytical functions. Many Redshift reporting queries use the analytic functions such as cumulative sum and average. But, because of Redshift limitation, you cannot call an analytics function within another. Whenever you try to call an analytics function within another analytics function, you will end up with an error such as "Invalid operation: aggregate function calls may not have nested aggregate or window function". In this article, we will check how to use the nested window functions in Amazon Redshift with…

Continue ReadingRedshift Nested Window Functions and Examples
Comments Off on Redshift Nested Window Functions and Examples

Different Methods to Create Redshift Tables – Examples

In my other posts, I have discussed various methods to create Redshift table from Spark DataFrame, Redshift Temporary tables, creating an index on Redshift tables, etc. In this article, we will check different methods and approach to create Amazon Redshift tables. We will also check differences between various methods to create tables in Redshift. Different Methods to Create Redshift Tables During development, developer create a table either permanently or temporarily as per the requirement. Developers usually create tables using DDL such as “CREATE TABLE” statement. But, sometimes you may need…

Continue ReadingDifferent Methods to Create Redshift Tables – Examples
Comments Off on Different Methods to Create Redshift Tables – Examples

SQL GROUPING SETS Alternative in Redshift

In my other articles, we have discussed GROUP BY with CUBE and GROUP BY ROLLUP alternatives. In this article, we will check this SQL GROUPING SETS alternative in Amazon Redshift with an example. The GROUPING SETS option in SQL gives you the ability to combine multiple GROUP BY clauses into one GROUP BY clause. The GROUPING SETS is one of the powerful GROUP BY extension. The group set is a set of dimension columns. Amazon Redshift does not support GROUPING SETS. SQL GROUPING SETS Alternative in Redshift GROUP BY GROUPING…

Continue ReadingSQL GROUPING SETS Alternative in Redshift
Comments Off on SQL GROUPING SETS Alternative in Redshift

SQL GROUP BY ROLLUP Function Alternative in Redshift

In my other articles, we have discussed GROUP BY with GROUPING SETS and GROUP BY with CUBE alternatives. In this article, we will check the SQL GROUP BY ROLLUP function alternative in Amazon Redshift. The relational databases such as Oracle, Teradata, etc. support GROUP BY ROLLUP function to group the result rows. However, Amazon Redshift does not support GROUP BY ROLLUP function. SQL GROUP BY ROLLUP Alternative in Redshift Similar to GROUP BY with CUBE, the GROUP BY ROLLUP is an extension of the GROUP BY clause that produces sub-total rows. Sub-total…

Continue ReadingSQL GROUP BY ROLLUP Function Alternative in Redshift
Comments Off on SQL GROUP BY ROLLUP Function Alternative in Redshift

SQL GROUP BY with CUBE Function Alternative in Redshift

In my other articles, we have discussed GROUP BY with GROUPING SETS and GROUP BY ROLLUP alternatives. In this article, we will check the SQL GROUP BY CUBE function alternative in Amazon Redshift. The relational databases such as Oracle, Teradata, etc. support GROUP BY with CUBE function to group the result rows. However, Amazon Redshift does not support GROUP BY with CUBE function. SQL GROUP BY with CUBE Function Alternative in Redshift The GROUP functions such as ROLLUP, CUBE, GROUPING SETS are an extension of the GROUP BY clause. The CUBE allows you to generate subtotals like…

Continue ReadingSQL GROUP BY with CUBE Function Alternative in Redshift
Comments Off on SQL GROUP BY with CUBE Function Alternative in Redshift

Amazon Redshift CONCAT Function-Syntax and Examples

The data warehouse is built from many heterogeneous data sources. It is a common requirement to combine data from multiple columns or two strings before loading them to target table. For example, you may get requirement to combine state and city columns before loading data to the customer table. In this article, we will check Amazon AWS Redshift CONCAT function, its Syntax and examples. We will also check how to combine two or more columns using Redshift CONCAT operator (||). Amazon Redshift provides multiple methods to concatenate the strings The…

Continue ReadingAmazon Redshift CONCAT Function-Syntax and Examples
Comments Off on Amazon Redshift CONCAT Function-Syntax and Examples