2 qq 28573739 qq_28573739 于 2016.03.11 15:55 提问

sql查数据除以100怎么做啊啊~~~

String queryString = "SELECT c.couponname, c.couponfee, c.pic1_path,date_format(c.endtime,'%Y-%c-%d') as endTimeFROM couponpublish c,couponpool s WHERE s.pubid=c.pubid AND s.owner='"+userId+"' ";
怎么把sql查到的couponfee除以100显示??

2个回答

pf_pingfan
pf_pingfan   2016.03.11 16:04

SELECT c.couponname, c.couponfee/100, c.pic1_path,date_format(c.endtime,'%Y-%c-%d') as endTimeFROM couponpublish c,couponpool s WHERE s.pubid=c.pubid AND s.owner='"+userId+"' ";

你试试

qq_28573739
qq_28573739 好使~
接近 2 年之前 回复
qq_26534747
qq_26534747   2016.03.11 16:07

String queryString = "SELECT c.couponname, c.couponfee*0.01, c.pic1_path,date_format(c.endtime,'%Y-%c-%d') as endTimeFROM couponpublish c,couponpool s WHERE s.pubid=c.pubid AND s.owner='"+userId+"' ";

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!