1

I have an array which has 3 dates : 2014-11-20 2014-11-25 2014-11-30

and I need to compare if those date are between 2014-11-01 AND 2014-11-30

I am trying to unnest the array and then compare between those dates but it is not working.

Any ideas?

1 Answer 1

1

HERE you are a working example, tested on postgresql 9.3:

SELECT * FROM UNNEST(ARRAY['20141120', '20141125', '20141130']::date[]) AS mycolumn
WHERE mycolumn > '20141101'
AND mycolumn < '20141130';
Sign up to request clarification or add additional context in comments.

2 Comments

> and < is not the same as BETWEEN, you need >= and <= or just BETWEEN
What do you need to join?

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.