1

I have a problem with a CAST function in PostgreSQL. In particular, I have to convert an arithmetic operation (a percentage calcul), where the operands are int type, in a bigint type. But when I type this command:

CAST(("Language".percentage * "Population".population) AS bigint) /100.0 AS pop_speak_lang

The outcome is:

ERROR: integer out of limits

If someone could help me I would really appreciate!

1 Answer 1

1

You don't need cast

"Language".percentage / 100.0 * "Population".population AS pop_speak_lang
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.