SQL

Articles tagged with SQL.

local_offer spark local_offer SQL

visibility 20
thumb_up 0
access_time 8 days ago

In Spark, function to_date can be used to convert string to date. This function is available since Spark 1.5.0. SELECT to_date('2020-10-23', 'yyyy-MM-dd'); SELECT to_date('23Oct2020', 'ddMMMyyyy'); Refer to the official documentation about all the datetime patterns.  ...

local_offer teradata local_offer SQL

visibility 8
thumb_up 0
access_time 2 months ago

Teradata has no built-in MD5 function thus custom function needs to be implemented for calculating MD5. This article shows you how to do that using the MD5 message digest UDF provided on Teradata Downloads. Permission CREATE FUNCTION is required for creating UDF in Teradata.  Navigate ...

local_offer teradata local_offer SQL

visibility 23
thumb_up 0
access_time 2 months ago

A procedure contains a number of SQL statements that will be executed in sequence in Teradata. Procedures can be used to return result sets to the invoking clients. In many other databases, it is very easy to return set records to the client in a procedure as SELECT statement can be directly used.

local_offer teradata local_offer SQL

visibility 40
thumb_up 0
access_time 2 months ago

Function CURRENT_TIMESTAMP can be used to retrieve the current timestamp: SELECT CURRENT_TIMESTAMP; Sample output: 20/09/2020 20:55:35.390000-04:00 Function CAST can be used to convert TimeStamp to DATE. SELECT CAST(CURRENT_TIMESTAMP AS DATE) Sample output: 20/09/2020 SELECT ...

local_offer teradata local_offer SQL

visibility 16
thumb_up 0
access_time 2 months ago

RANDOM function in Teradata returns a random integer number for each row of the results table. It is a Teradata extension to the ANSI SQL:2011 standard. Random(lower_bound, upper_bound) The limits for  lower_bound   and upper_bound range from -2147483648 to 2147483647 ...

local_offer teradata local_offer SQL

visibility 44
thumb_up 0
access_time 2 months ago

This article demonstrates how to create volatile table in a Teradata procedure, perform DML actions (INSERT, DELETE, UPDATE) against it and then return the result set dynamically from the temporary table in the procedure.

local_offer teradata local_offer SQL local_offer teradata-functions

visibility 26
thumb_up 0
access_time 2 months ago

In SQL Server, ISNULL function is commonly used to populate a value for null columns.  In Teradata, there is no ISNULL function but COALESCE and CASE WHEN can be used as alternatives.  SELECT COALESCE(NULL,'ABC','CDE'); Result: ABC SELECT COALESCE(Col1, Col2,'DEFAULT') FROM ...

local_offer teradata local_offer SQL local_offer teradata-functions

visibility 31
thumb_up 0
access_time 2 months ago

Teradata RPAD function is used to add repeated characters at the end of a string to increase the string to a specified length. It can be used to add trailing space or zeros to a string. RPAD(source_string, length, fill_string) Returns the source_string padded to the right with the characters in ...

local_offer teradata local_offer SQL local_offer teradata-functions

visibility 59
thumb_up 0
access_time 2 months ago

Teradata LPAD function is used to add repeated characters at the beginning of a string to increase the string to a specified length. It can be used to add leading space or zeros to a string. LPAD(source_string, length, fill_string) Returns the source_string padded to the left with the ...

local_offer teradata local_offer SQL local_offer teradata-sql-query

visibility 95
thumb_up 0
access_time 3 months ago

XML data type is commonly supported in Teradata. Together with native XML type, a number of XML functions are added to support extracting values from XML, shredding and publishing JSON, etc.  info The following code snippets use string literal to demonstrate the usage of these functions; you ...

Read more

Find more tags on tag cloud.

launch Tag cloud