SQL的截取 - MS-SQL Server / 基础类
数据库中price(列)是 :123600
现要弄成:12.40万 或者 12.30万
SQL code:
select ltrim(cast(price*10/10000/10.0 as dec(18,2)))+'万'
from tb
select 123600.0/10000
---------------------------------------
12.3600000
(1 行受影响)
SQL code:
select ltrim(cast(round(price/10000.0,1) as dec(18,2)))+'万' as price from [tb]
SQL code:
select ltrim(cast(round(price/10000.0,1) as dec(18,2)))+'万' as price from tb
SQL code:
ltrim(cast(round(price/10000.0,2) as dec(18,2))) as price
相关问答:
protected void btnLogin_Click(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection("Server = (local);user id = sa;pwd = 1;database = Login");
&nb ......
字段1,字段2.....字段N,Status,ParentID
1,Name1....test1,1,99
1,Name1....test1,3,99
1,Name2....test2,1,101
1,Name2....test2,3,101
1,Name3....test3,2,101
1,Name1....test1,4,101
想要的结果是:
1,Na ......
id url rank ......
我想查询出每天数据的最大的一个值。表的格式如下
表名: hisdata
字段 编号 值 状态 时间
Id value state dattime
101 32.3 0 ......
求个vb中的sql语句的写法,次sql语句的用法是分页程序
我写的如下:其中A是用来接收每页显示的记录的条数,B是用来接收显示的当前的页面.
sqltext="select top A * from log where id not in(select top ( ......