如何获得;int";json中的值结果为;“字符串”;使用metamug
例如:我得到如何获得;int";json中的值结果为;“字符串”;使用metamug,json,metamug,Json,Metamug,例如:我得到[{“id”:100}] 虽然我需要:[{“id”:“100”}]您需要以字符串的形式发送整数值。要将整数转换为字符串,可以使用CONCAT()函数 像这样的 <?xml version="1.0" encoding="UTF-8" ?> <Resource xmlns="http://xml.metamug.net/resource/1.0" v="1.1"> <Request method="GET"> <Quer
[{“id”:100}]
虽然我需要:
[{“id”:“100”}]
您需要以字符串的形式发送整数值。要将整数转换为字符串,可以使用CONCAT()函数
像这样的
<?xml version="1.0" encoding="UTF-8" ?>
<Resource xmlns="http://xml.metamug.net/resource/1.0" v="1.1">
<Request method="GET">
<Query>
select CONCAT('',100) as 'id'
</Query>
</Request>
</Resource>
或者,使用CAST()函数也将产生相同的结果
<Query>
select CAST(100 as char(5)) as 'value'
</Query>
选择CAST(100作为字符(5))作为“值”
<Query>
select CAST(100 as char(5)) as 'value'
</Query>