By using this site, you acknowledge that you have read and understand our Cookie policy, Privacy policy and Terms .
access_time 11 months ago visibility143 comment 0 languageEnglish

In Oracle database, you can select from dual table if you only want to return a one row result set. In many other databases, the query engine supports select directly from constant values without specifying a table name. 

In Hive, there is no system table named Dual. However you can directly created table name Dual.

Alternatively, you can also directly query from constant values or built-in functions without specifying a table name.

Code snippet

CREATE TABLE DUAL(Dummy VARCHAR(1));
INSERT INTO DUAL VALUES ('X');
SELECT CURRENT_DATE from DUAL;
SELECT CURRENT_DATE;
info Last modified by Raymond at 11 months ago * This page is subject to Site terms.

More from Kontext

local_offer teradata local_offer SQL

visibility 18
thumb_up 0
access_time 5 days ago

OREPLACE functions in Teradata can be used to replace or remove characters from a string. OREPACE is Teradata's extension to ASNI SQL. The usual REPLACE function is not available. ANSI SQL REPLACE function REPLACE function is commonly implemented in many other SQL databases such as ...

open_in_new View open_in_new Code snippets

local_offer teradata local_offer SQL

visibility 15
thumb_up 0
access_time 26 days ago

Extract sub string from a string is a common operation in data analytics. In Teradata, function SUBSTRING (SUBSTR) and REGEXP_SUBSTR are provided to achieve that. SUBSTR is used to extract string from a specified location while REGEXP_SUBSTR is used to extract string using regular expressions. ...

open_in_new View open_in_new Code snippets

local_offer teradata local_offer SQL

visibility 30
thumb_up 1
access_time 26 days ago

COALESCE function in Teradata returns NULL if all arguments evaluate to null; otherwise it returns the value of the first non-null argument. NULLIF is to used evaluate two expressions and returns NULL if the two arguments are equal otherwise if returns the first arguments. IS NULL i...

open_in_new View open_in_new Code snippets

local_offer teradata local_offer SQL

visibility 23
thumb_up 0
access_time 26 days ago

In SQL Server, TRY_CAST function returns a value cast to a specified data type is the cast is successful or null is the cast is not successful.  In Teradata, the equivalent function is TRYCAST. Code snippets -- return int 1030 SELECT TRYCAST('01030' AS int); -- retur...

open_in_new View open_in_new Code snippets

info About author

Dark theme mode

Dark theme mode is available on Kontext.

Learn more arrow_forward
Kontext Column

Kontext Column

Created for everyone to publish data, programming and cloud related articles. Follow three steps to create your columns.

Learn more arrow_forward
info Follow us on Twitter to get the latest article updates. Follow us