Is it possible to include a double table in a connection request?

Can I include a DUAL table in a connection request?

Can someone give me an example that includes SYSTIMESTAMPfrom a double table.

+5
source share
4 answers

One common use (for me) is to use it to create inline views for joining ...

SELECT
  filter.Title,
  book.*
FROM
(
  SELECT 'Red Riding Hood'  AS title FROM dual
  UNION ALL
  SELECT 'Snow White'       AS title FROM dual
)
  AS filter
INNER JOIN
  book
    ON book.title = filter.title

[This is a deliberately trivial example.]

+3
source

In principle, you can, but there is no need.
you can add the systimestamp column alias to any query that you already have:

SELECT t.col1, t.col2, systimestamp
FROM your_table t

Will give the same results as

SELECT t.col1, t.col2, d.st
FROM your_table t, (select systimestamp st from dual) d

, , .

+1

Try this solution:

 select (select SYSTIMESTAMP from dual ) as d
        /*
           Here you can add more columns from table tab
        */ 
 from tab
0
source

There should be no need, the keyword DUALis a way of saying that you are not querying the table, if you want to β€œjoin” DUALto another table, just go to another table, including your columns that are not in the table in the select clause.

EDIT: As the comments say, this statement is false - this is a table. DUAL

I still think it makes no sense to include (with a question)

DUAL table in join

0
source

All Articles