By using this site, you acknowledge that you have read and understand our Cookie policy, Privacy policy and Terms .
close

Code snippets for various programming languages/frameworks.

rss_feed Subscribe RSS

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 9 months ago
info About author

info License/Terms

More from Kontext

local_offer teradata local_offer SQL

visibility 22
comment 0
thumb_up 0
access_time 3 months ago

This code snippet shows how to calculate time differences.

open_in_new View

local_offer teradata local_offer SQL

visibility 46
comment 0
thumb_up 0
access_time 3 months ago

JSON is commonly used in modern applications for data storage and transfers. Pretty much all programming languages provide APIs to parse JSON. 

open_in_new View

local_offer SQL local_offer hive

visibility 203
comment 0
thumb_up 0
access_time 3 months ago

In different databases, the syntax of selecting top N records are slightly different. They may also differ from ISO standards.

open_in_new View

local_offer teradata local_offer SQL

visibility 24
comment 0
thumb_up 0
access_time 3 months ago

In different databases, the syntax of selecting top N records are slightly different. They may also differ from ISO standards.

open_in_new View