尝试使用 ORDER BY 时出现 ORA-01722
ORA-01722 when trying to use ORDER BY
我有以下简单的 SQL 查询,其中 returns 数据正常:
select ticket_id,executor_id
from e2efr
where executor_id in (60882,91279)
当我想排序时:
select ticket_id,executor_id
from e2efr
where executor_id in (60882,91279)
order by ticket_id
我收到错误消息:
ORA-01722: invalid number
01722. 00000 - "invalid number"
*Cause: The specified number was invalid.
*Action: Specify a valid number.
怎么可能!?
只需将数字作为字符串给出即可。 executor_id 中的某些值无法转换为数字,因此出现错误。
select ticket_id,executor_id
from e2efr
where executor_id in ('60882','91279')
order by ticket_id
我有以下简单的 SQL 查询,其中 returns 数据正常:
select ticket_id,executor_id
from e2efr
where executor_id in (60882,91279)
当我想排序时:
select ticket_id,executor_id
from e2efr
where executor_id in (60882,91279)
order by ticket_id
我收到错误消息:
ORA-01722: invalid number
01722. 00000 - "invalid number"
*Cause: The specified number was invalid.
*Action: Specify a valid number.
怎么可能!?
只需将数字作为字符串给出即可。 executor_id 中的某些值无法转换为数字,因此出现错误。
select ticket_id,executor_id
from e2efr
where executor_id in ('60882','91279')
order by ticket_id