Checking specific column in data source created of multiple tables

21 views Asked by At

A data source called 'D_UNITED_DATA' is created of multiple tables that are joined together, mostly by inner join.

I need to check how the column called 'Music Order' from table 'Music Records' looks like after being joined and added to that data source.

How to check that specific column?

I tried

SELECT 'Music Order'
FROM IRB.D_UNITED_DATA

but it just writes out Music Order many times.

I am using Oracle SQL Developer.

1

There are 1 answers

2
MT0 On

In Oracle:

  • 'value' is for string literals.
  • "identifier" is a (case-sensitive) quoted identifier for a column/table/alias/etc.
  • identifier is a (non-quoted) identifier (that will be implicitly converted to UPPER-CASE and allow you to effectively use case-insensitive identifiers).

You probably want:

SELECT Music_Order
FROM IRB.D_UNITED_DATA

or, if you really do have a space in the column name:

SELECT "Music Order"
FROM IRB.D_UNITED_DATA

If you need to JOIN a Music Records table then include that in the query:

SELECT "Music Order"
FROM   IRB.D_UNITED_DATA d
       INNER JOIN "Music Records" mr
       ON d.something = mr.something

Note: Using quoted identifiers is considered bad practice as you have to use quoted identifiers everywhere the column is referenced and have to exactly match the case used in the table definition; it is considered better practice to use non-quoted identifiers and not include spaces in identifiers.