Questions tagged [dual-table]

The DUAL table is a special one-row, one-column table. It is present by default in Oracle and other database installations. In Oracle, the table has a single VARCHAR2(1) column, called DUMMY, that has a value of 'X'. It is suitable for use in selecting a pseudo-column, such as SYSDATE or USER.

The DUAL table is a special one-row, one-column . It is present by default in and other database installations. In Oracle, the table has a single VARCHAR2(1) column, called DUMMY, that has a value of X. It is suitable for use in selecting a pseudo-column, such as SYSDATE or USER.

Useful Links:

30 questions
258
votes
14 answers

What is the dual table in Oracle?

I've heard people referring to this table and was not sure what it was about.
Brian G
  • 53,704
  • 58
  • 125
  • 140
77
votes
6 answers

What is the equivalent of the Oracle "Dual" table in MS SqlServer?

What is the equivalent of the Oracle "Dual" table in MS SqlServer? This is my Select: SELECT pCliente, 'xxx.x.xxx.xx' AS Servidor, xxxx AS Extension, xxxx AS Grupo, xxxx AS Puerto FROM DUAL;
wabregoc
  • 1,064
  • 2
  • 12
  • 17
6
votes
4 answers

pseudo columns & DUAL table - what do they actually mean?

Dual table is used to select pseudo columns. it has one row and one column DUMMY which has a value X. I have two questions What actually does a pseudo column mean? How is the dual able to give the value for example: select sysdate from dual will…
Vijay
  • 65,327
  • 90
  • 227
  • 319
6
votes
1 answer

The magic of DUAL

Under normal conditions (not using SYS or maybe using it)- SQL> select * from dual; D - X Under not so normal conditions (connected as SYS)- SQL> alter database close; Statement processed. SQL> select * from dual; ADDR INDX INST_ID …
Anjan Biswas
  • 7,746
  • 5
  • 47
  • 77
5
votes
2 answers

SQL (Oracle) Select without an actual table containing static data

I am looking for a possibility to run an (Oracle) SQL without querying an actual table. Here I found a tip with the DUAL table. Thats pretty good. But I'm looking for a short solution to select MULTIPLE rows from "nowhere". Is that possible? Here is…
Sauer
  • 1,429
  • 4
  • 17
  • 32
5
votes
1 answer

What is Teradata's equivalent for Oracle's DUAL

In Oracle, we can write this to generate a single row using a SELECT statement. SELECT 1 AS x FROM dual What is Teradata's equivalent?
Lukas Eder
  • 211,314
  • 129
  • 689
  • 1,509
4
votes
2 answers

Oracle select from dual with multiple rows and columns

I need to join against a dynamic list of numbers that I retrieve from my program dynamically. The number of rows is not fixed, nor are the numbers that are used. I am not finding a better way to accomplish this than with the following (for my…
Jeremy
  • 1,015
  • 4
  • 11
  • 20
4
votes
3 answers

Recreate the Oracle DUAL table

Is there any way to create / recreate dual table in Oracle? It was accidentally dropped.
Avg
  • 111
  • 2
  • 4
4
votes
1 answer

MySQL Dual table Join Dual table

Is there a way to JOIN fields from the dummy DUAL table in MySQL? Say I have a SELECT 1 as n1 FROM DUAL n1 -- 1 and a SELECT 2 as n2 FROM DUAL n2 -- 2 Can I join both selects with a Join in some kind of query as... SELECT 1 as n1 FROM DUAL…
Javier Novoa C.
  • 11,257
  • 13
  • 57
  • 75
3
votes
1 answer

Select exact number of rows from dual table

The task is the following: select 20 rows from dual table with randomly generated distinct numbers from 23 to 45. I performed the following: select distinct floor(dbms_random.value(23,45)) output from dual connect by rownum <= 20; But it selects…
2
votes
4 answers

how to select a list of 10,000 unique ids from dual in oracle SQL

So I can't create or edit tables (I'm a user with read only permission) and I want to look up 10,000 unique id's. I can't put them inside of an IN() statement because oracle limits over 1000 items. Is it possible to select this entire list from…
barker
  • 1,005
  • 18
  • 36
2
votes
2 answers

Internal Functionality of DUAL table?

Will local database get disturb if we create DUAL table ? Kindly Suggest me ? create table DUAL ( x varchar2(1) );
MastanSky
  • 57
  • 1
  • 10
2
votes
2 answers

ORA-00904 'invalid identifier' error using 'MERGE INTO' and 'SELECT FROM dual' on a DATE column

I have the following PL/SQL stored procedure on an Oracle database: PROCEDURE MyProcedure ( p_id IN NUMBER , p_date IN DATE , p_num IN NUMBER) AS BEGIN MERGE INTO MY_TABLE mytable USING (SELECT p_id, …
Neo
  • 4,145
  • 6
  • 53
  • 76
1
vote
3 answers

Oracle SQL - counting to 3

This is an easy one, but I really can't figure it out. I am trying to get this simple table: NUMBER 1 2 3 So I try this: select (1,2,3) as number from dual; and I get ORA-00907: missing right parenthesis 00907. 00000 - "missing right…
Jeremy
  • 5,365
  • 14
  • 51
  • 80
1
vote
1 answer

Oracle join dual daterange

I'm trying to place data into a date range from a dual query. The outcome should look like this: SINGLEDAY FLAG 01-NOV-2016 1 02-NOV-2016 - 03-NOV-2016 - 04-NOV-2016 1 05-NOV-2016 - For the list of days I'm using select…
fscherbaum
  • 59
  • 1
  • 1
  • 5
1
2