0

is there anyone at there who knows how to use a variable interval instead of a number interval in postgresql?

For example :

1
  • This loop really looks strange. What are you trying to do there? More often than not, a "LOOP" approach is the worst solution you can use. Also: the SELECT p1_per_rot into nbmois FROM opt_par is dangerous as you are not using an WHERE clause to limit the number or rows from opt_par Commented Aug 13, 2021 at 13:58

1 Answer 1

1

You can use make_interval()

make_interval(days => 1, months => nbmois);
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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.