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

Redshift vs Snowflake – Key Differences

Data is the lifeline for many companies. Be it is an advertising company or decision making company, data plays an important role in each and every step. To understand and utilize all this data, data warehouses have become an essential part of modern business. There are many data warehouse appliance such as Teradata, Vertica, Greenplum, etc are available in the market. But, nowadays, organizations are more inclined towards cloud data warehouses such as Snowflake, Redshift, Azure SQL Synapse, Google cloud Spanner, etc. In this article, we will check key differences…

Continue ReadingRedshift vs Snowflake – Key Differences
Comments Off on Redshift vs Snowflake – Key Differences

Oracle INSERT ALL Alternative in Hive/Spark SQL

Oracle database is one of widely used relational databases. It supports many syntax that are not available in any other transaction databases. One of such command is INSERT ALL. The INSERT ALL is used to insert computed records into multiple tables based on conditions. In this article, we will check what is Oracle INSERT ALL alternative in Hive and Spark SQL. Oracle INSERT ALL alternative in Hive/Spark SQL When migrating Oracle scripts to Apache Hive and Spark SQL, you will notice Hive and Spark SQL does not support many Oracle…

Continue ReadingOracle INSERT ALL Alternative in Hive/Spark SQL
Comments Off on Oracle INSERT ALL Alternative in Hive/Spark SQL

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

Best Amazon Redshift Query Tools – SQL Editors

Similar to Snowflake, Amazon Redshift is a cloud based data warehouse and is a component of Amazon web services (AWS). Amazon Redshift supports both ODBC and JDBC connection. There are many companies released a tool that uses Redshift ODBC or JDBC driver to connect Redshift. In this article, we will check some of best Amazon Redshift query tools or SQL editor that you can use. Best Amazon Redshift Query Tools - SQL Editors Many SQL developers are comfortable with the tools to execute queries and play around data. There are…

Continue ReadingBest Amazon Redshift Query Tools – SQL Editors
Comments Off on Best Amazon Redshift Query Tools – SQL Editors

UNLOAD Redshift Table to S3 and Local

Amazon Redshift unload command exports the result or table content to one or more text or Apache Parquet files on Amazon S3. It uses Amazon S3 server-side encryption. You can unload the result of an Amazon Redshift query to your Amazon S3 data lake in Apache Parquet, an efficient open columnar storage format for analytics. In this article, we will check how to unload Redshift table to Amazon S3 and later download it to the local system using Amazon AWS command line interface (CLI). Unload Redshift Table Unload command unloads…

Continue ReadingUNLOAD Redshift Table to S3 and Local
Comments Off on UNLOAD Redshift Table to S3 and Local