select * from user where userId in(select..id....) 无效数字 userId为varchar 型的 select 查询出来的为number型的 加一个to_char 问题解决
例如:select * from user where userId in(select to_char(id) id from .....)
本文介绍了一种解决SQL查询中类型不匹配的问题的方法。具体来说,在进行in子查询时,如果外部查询字段类型为varchar而内部查询返回number类型,则会导致查询失败。文章通过使用to_char函数将内部查询结果转换为字符串类型来解决问题。
1401
669

被折叠的 条评论
为什么被折叠?