Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How can I select an element that doesn't exists in a table?
jose_luis_fdez_diaz wrote:
> Idem.
>
> Thanks in advance,
> Jose Luis.
I am not 100% sure what you are trying to accomplish.
Your can select from dual:
SELECT
SYSDATE CURRENT_DATE
FROM
DUAL;
SELECT
'Hello World'
FROM
DUAL;
You can select from a table, bringing along with it a text constant,
and a date constant:
SELECT
SID,
SERIAL#,
'User' TEXT_MESSAGE,
SYSDATE CURRENT_DATE
FROM
V$SESSION;
If you are wanting to return a row, even when a matching value does not
appear in the table, perform an outer join (left outer join) between a
table containing the full list of values and the table of interest:
SELECT
SID,
SERIAL#,
'User' TEXT_MESSAGE,
SYSDATE CURRENT_DATE
FROM
V$SESSION S,
MY_SESSION_HISTORY SH
WHERE
SH.SID=S.SID(+);
Charles Hooper
PC Support Specialist
K&M Machine-Fabricating, Inc.
Received on Mon Nov 13 2006 - 05:57:37 CST