如何查询一段数据的末几位 我这有个数列A里面有123456,234567,345678我想利用数据库查询该数列A得到结果为456,567,678请问谁可以提供下语句谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select substring(A,3,20)from table小菜,呵呵,请给分吧,答案非常之正确 应该是select substring(A,4,3) from table 这样吧.从第4位开始读取后3位 select right(ltrim(列),3) from 表 create table tb(s int)insert into tb select 123456insert into tb select 234567insert into tb select 345678select right(ltrim(s),3) from tb456567678 select right(rtrim(column),3) from table --如果A列是整型select right(A,3) from 表名--如果A列是字符型select right(rtrim(A),3) from 表名 大家帮忙看下,怎么使用存储过程解决统计数据的问题!! 看到一个贴子后感!请进! SQL CRL函数疑难问题:如何实现返回不定字段 如何用一条sql语句来删除一个表中的所有记录。 问个弱智的问题 知道日期,如何按照年月统计 求一条联合查询删除的语句 数据表多对多关系 是用关联表还是用字段拼接? 有一个怪事? 启动SQL7.0中的Query Analyzer界面问题? 在数据库中要用decimal不能用float 那在程序中呢? 数据导入问题
from table小菜,呵呵,请给分吧,答案非常之正确
select substring(A,4,3)
from table
这样吧.从第4位开始读取后3位
insert into tb select 123456
insert into tb select 234567
insert into tb select 345678select right(ltrim(s),3) from tb456
567
678
select right(rtrim(column),3) from table
select right(A,3) from 表名
--如果A列是字符型
select right(rtrim(A),3) from 表名