L
leon.zhou
Unregistered / Unconfirmed
GUEST, unregistred user!
Inta,Intb是两个整型字段,我想查询后得到的样子为:‘Inta/Intb’,是一个字符串类型的.
SQL语句如下:
select (Inta + '/' + Intb) as Test from mytable
报告错误:标准表达式中数据类型不匹配
select (cast(Inta as varchar(10)) + '/' + cast(Intb as varchar(10)) as Test from mytable
报告错误:语法错误(操作符丢失)在查询表达式‘(cast(Inta as varchar(10)) + '/' + cast(Intb as varchar(10))’中
请问我该如何写这个sql呢?谢谢了!
SQL语句如下:
select (Inta + '/' + Intb) as Test from mytable
报告错误:标准表达式中数据类型不匹配
select (cast(Inta as varchar(10)) + '/' + cast(Intb as varchar(10)) as Test from mytable
报告错误:语法错误(操作符丢失)在查询表达式‘(cast(Inta as varchar(10)) + '/' + cast(Intb as varchar(10))’中
请问我该如何写这个sql呢?谢谢了!