When making a query that needs joining two or more tables, you need to know the primary key/s of the tables.
The command DESCRIBE <TABLE_NAME> will not show you the primary key.
To get the primary key, use this query:
SELECT B.COLUMN_NAME FROM ALL_CONSTRAINTS A, ALL_CONS_COLUMNS B WHERE A.CONSTRAINT_NAME=B.CONSTAINT_NAME AND A.OWNER=B.OWNER AND A.TABLE_NAME=<TABLE_NAME> AND A.CONSTRAINT_TYPE='P';
Change <TABLE_NAME> with the table name.
Advertisement