橋本です。 > ERROR: column "cb" is of type integer but expression is of type text > HINT: You will need to rewrite or cast the expression. > このエラーメッセージを見る限り、型があっていないように見えます。 (UNIONを使うと変わっちゃう?) キャストして型を変換してみてはいかがでしょうか? CAST(99 As int) か 99::int ですね。