In MSSQL I can type into script editor and execute the following:
SELECT 'TEST' AS MyColumn
Which will output a single row containing TEST in a column called MyColumn
What is the equivalent in Oracle?
In MSSQL I can type into script editor and execute the following:
SELECT 'TEST' AS MyColumn
Which will output a single row containing TEST in a column called MyColumn
What is the equivalent in Oracle?
it is:
SELECT 'TEST' AS MyColumn FROM dual;
Dual is a table with one column and one record, built into Oracle especially for this purpose:
SELECT * FROM dual;
yields
Dummy
-----
X
If you would construct this table in other databases, queries on dual would also work. (I use this to unit test Oralcle-queries on Sqlite)
You just need FROM DUAL
:
SELECT 'TEST' AS MyColumn
FROM DUAL;
DUAL
is a special built-in table that has one row.