Home > Software engineering >  Oracle query to select columns from a schema
Oracle query to select columns from a schema

Time:11-21

I have a schema, in which there are many tables and which thus contains many columns. Is there a way I can select specific columns from the scheme?

CodePudding user response:

Just specify the name of the schema, table and columns in the query. For example:

SELECT column1, column3, column4
FROM   schema_name.table_name

If you want to query multiple tables then use appropriate joins. For example:

SELECT t1.column1,
       t1.column3,
       t2.column4,
       t3.column1 AS t3_column1
FROM   schema_name.table1 t1
       CROSS JOIN schema_name.table2 t2
       INNER JOIN schema_name.table3 t3
       ON (t1.columnX = t3.columnY)

CodePudding user response:

Not sure if you mean you need to find columns having specific names within the tables of a schema. If so, below post gives details on which dictionary tables/views to check for table/column meta data -
How to get all columns' names for all the tables in Oracle?

  • Related