**库查询语句

时间:2013.12.05 发布人:uabvkp77

**库查询语句

已解决问题

谷歌uabvkp77用户在2013.12.05提交了关于“自由舰**库查询语句”的提问,欢迎大家涌跃发表自己的观点。目前共有1个回答,最后更新于2024-05-16T07:01:46。有条语句我想实现这样的功
selectdistinctrepnamefromrmpwhererepidin(selectrepidsfromtempssn)
其中rmp.repdi字段是int,tempssn.repids字段是varchar(2000)
在执行过程中,DBMS提示在将varchar值'1141,1142'转换成**类型int时失败。
请问我该怎样改?谢谢希望大家能够帮助她。

详细问题描述及疑问:有条语句我想实现这样的功
selectdistinctrepnamefromrmpwhererepidin(selectrepidsfromtempssn)
其中rmp.repdi字段是int,tempssn.repids字段是varchar(2000)
在执行过程中,DBMS提示在将varchar值'1141,1142'转换成**类型int时失败。
请问我该怎样改?谢谢期待您的答案,不知道说什么,送你一朵小红花吧 !

希望以下的回答,能够帮助你。

第1个回答

用户名:pqgegq  

你可以试试
selectdistinctrepnamefromrmpwhereconvert(varchar,repid)in(selec来自trepidsfromtempssn)
或者
selectdistinctrepnamefromrmpwherecast(repidasvarchar)in(selectrepidsfromtempssn)