SQL的select查询,字符型转int型并进行运算的问题
skyan 2003-05-21 11:52:04 两个字符型的字段转成整型,并按price1与price2 相除得出的结果排序的查询
select id,price1/price2 as price from table order by price1/price2
select id,convert(int ,price1)/convert(int ,price2) as price from table order by convert(int ,price1)/convert(int ,price2)
上面两个查询语句都错了,为什么?