snippetMinor
Is it possible in Firebird to create a single index with ascending and descending columns?
Viewed 0 times
createdescendingwithcolumnspossiblesingleandindexfirebirdascending
Problem
For instance, something equivalent to
CREATE INDEX Listing_Date_Idx ON ACTIVITY(Listing,Date_ DESC,Time_ DESC);Solution
The syntax for index creation does not allow for this:
As you must set a single order for the entire index, not for each individual column.
However,
It is quite valid to define both an ascending and a descending index
on the same column or key set.
CREATE [UNIQUE] [ASC[ENDING] | [DESC[ENDING]] INDEX indexname
ON tablename
{ ( [, ...]) | COMPUTED BY (expression) }
::= a column not of type ARRAY, BLOB or COMPUTED BYAs you must set a single order for the entire index, not for each individual column.
However,
It is quite valid to define both an ascending and a descending index
on the same column or key set.
Code Snippets
CREATE [UNIQUE] [ASC[ENDING] | [DESC[ENDING]] INDEX indexname
ON tablename
{ (<col> [, <col> ...]) | COMPUTED BY (expression) }
<col> ::= a column not of type ARRAY, BLOB or COMPUTED BYContext
StackExchange Database Administrators Q#193064, answer score: 6
Revisions (0)
No revisions yet.