如何把查询出来的文章内容只取前50个字?100分 select left(fieldname,50) from tablename 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select substring('我有一张表,有一个字段存一些用户发的文章但是我现在查询只想显示这些文章的前50个字(有的文章总共也不到50字)怎么做呢?最好是在数据库这边做,不知道sql语句应该怎么写?谢谢',1,50) declare @str varchar(100)set @str='123456789012345678901234567890'select substring(@str,1,10) ---取前10个字符--结果-------------------- 1234567890 select left('text',50) from .... select substring(文章,1,50) as 文章 from YourTable where len(文章) >= 50union allselect 文章 from YourTable where len(文章) < 50 我是用的text的字段,所以好像用left不行不过用substring可以谢谢了 空值替换的函数是什么 SQL SERVER2000 时发现其使用的内存不断增大 sql server inner join and 在access中用什么代替? 关于日期运算 基础问题 【难题!紧急】如何判断一个表中是否存在关键字段满足一些变态条件的记录并对其操作?请各位大虾指教! 统计每天点击次数 SQL里如何实现复杂多字段分列???? 关于Indentity中使用变量的问题! 有哪位大侠知道如何删除数据库中重复数据的命令? 成都那里有好点的数据库设计培训啊?谢谢! 存储过程为什么不能返回参数?
',1,50)
set @str='123456789012345678901234567890'
select substring(@str,1,10) ---取前10个字符--结果--------------------
1234567890
union all
select 文章 from YourTable where len(文章) < 50
不过用substring可以
谢谢了