: expected CHAR got NUMBER
时间: 2024-01-27 13:04:01 浏览: 192
python3.7解决最小二乘遇到ValueError:Expected 2D array, got 1D array instead: array=[5.].关于reshape和predict
根据提供的引用内容,问题是关于SQL语句中的数据类型错误的。根据引用\[3\]中的解释,字段tsex为int类型,但是在case语句中,when 1 then后定义的是字符类型。因此,需要确保else后的类型与then后的类型保持一致。可以将else后的类型修改为数字类型,例如999。这样就可以解决错误。以下是修改后的SQL语句:
select case grouping_id(tsex)
when 1 then 999
else t.tsex
end as "tsex",
count(tsex)
from test_0128 t
group by grouping sets(tsex,null)
order by tsex;
#### 引用[.reference_title]
- *1* *2* *3* [【oracle_报错】ORA-00923: inconsistent datatypes: expected CHAR got NUMBER](https://blog.csdn.net/debimeng/article/details/86686429)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文