怎么查询出不够位数在左边加个零? 如果有张表有1280条记录,要查询多少条记录,select count(*) as count from 表count 1280如果要查询出象下面的效果这句sql怎么写?count 001280 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select right('0000000'+ltrim(*),7) as [count] from tb declare @i intset @i=55select right('0000'+ltrim(@i),5)00055 select right('0000000'+ltrim(count(*)),7) as [count] from tb declare @i intset @i=1280select right('00000'+ltrim(@i),6)001280把@i换成count(1)就行了select right('00000'+ltrim(count(*)),6) from tb 签到 :)select right(1000000 +count(*),6) from tb select right('000000'+ltrim(count(*)),6) as [count] from tb declare @i intset @i=1280select right('00000'+ltrim(@i),6) 有没有sql语句可以删除文件的? 请问UPdate语句能像insert一样里面用select语句吗? jyxhz 在不在,急寻再解存储过程中的有字符的双循环,的问题~在线等~!! 如何建立自动加一的字段??? 莫名其妙的数据库异常 求助:如何通过SQL脚本将文本文件导入到数据库表中? 急,请大侠帮忙,谢谢! 一条SQL语句的优化 这样的脚本为什么不对? 有关锁的问题??? 该怎样建这个库?多个层次结构的? 关于字段查询条件 SQL 入门问题之多列排序
set @i=55
select right('0000'+ltrim(@i),5)00055
set @i=1280
select right('00000'+ltrim(@i),6)001280把@i换成count(1)就行了select right('00000'+ltrim(count(*)),6) from tb
select right(1000000 +count(*),6) from tb
set @i=1280
select right('00000'+ltrim(@i),6)