Skip to content

Count issue in Oracle with composite key #205

@sungongpeng

Description

@sungongpeng

OData count from a composite key,
http://[localhost:9010/Trippin/v1/Trips?$count=true
translate to query again db
SELECT COUNT(DISTINCT(E0."ID", E0."Entity")) S0 FROM "Trippin"."Trip" E0
works fine with hsqldb.

but for Oracle database, it throw ORA-00907: missing right parenthesis error.

how to customize the query to one that can run in Oracle database, like
SELECT E0."ID" || E0."ENTITY" || E0."DATA" FROM "PENFAX"."TRIP" E0

OR

SELECT COUNT (*) FROM (
SELECT DISTINCT E0."ID" S0, E0."ENTITY" S1, E0."DATA" S2 FROM "PENFAX"."TRIP" E0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions