Oracle “Invalid Number” caused by to_char function
问题 I have the following SQL query which is looking for duplicate values in a table (two values being null must be classed as a duplicate, hence the use of nvl): select * from PersonLinkTable personLink where personLink.RefPerson = 100 and nvl(to_char(personLink.PersonLinkType), '###') = nvl(to_char(PersonLinkTable.PersonLinkType), '###') // Repeats for required columns The third line repeats for the required columns, and is generated automatically in case any new columns are added in the future.