This problem occurs when Union all is used to merge two result sets of select queries, the type of a field appears.
Different from the type of the corresponding field.
Because SQL is relatively long, one field is excluded. Finally found
Field bizdate: Select to_char (fbizdate, 'yyyy-mm-dd hh24: MI: ss') as bizdate --- fbizdate itself is datetime type to character type
Field ***: Select snumber ---- snumber does not know whether its data type can be a character, but does not know whether it is Char or varchar.
The problem occurs:
E. g:
Select to_char (fbizdate, 'yyyy-mm-dd hh24: MI: ss ')
Union all
Select snumber
I always thought that snumber is a character type, but it is indeed a character type, but also has char, varchar
So I made a mistake. Since the preceding fields are converted to Char, the following fields must also be converted to Char, that is, to_char (snumber)
Suddenly I found the database really annoying ..