简体   繁体   中英

PostgreSQL: CAST function

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!

你不需要演员

"Language".percentage / 100.0 * "Population".population AS pop_speak_lang

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM