0

Simple table

create table x(t timestamp);

in many places i need to say

where extract(year from t) and extract(quarter from t)

can we state an expression index here ? and how

1 Answer 1

1

You can use below SQL:

create index idx_cust_test on x(extract(year from t), extract(quarter from t));

The whole script can be checked on: fiddle

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.