Search code examples
sqloracle-databaseoracle11goracle12c

Is there a way querying alias and partition together?


I want to querying like

select enp.LAST_NAME from EMPLOYEES enp partition("P20120101");

When I try It oracle says;

> ORA-00924: missing BY keyword

Is there a way to use alias and partition together?


Solution

  • The correct syntax is

    FROM <TABLE_NAME> PARTITION(<PARTITION_NAME>) <ALIAS_NAME>

    So, try select enp.LAST_NAME from EMPLOYEES partition("P20120101") enp;