从数据库中拿出几句话 [英] taking few words from database
本文介绍了从数据库中拿出几句话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在一个表中,列名是Discription,它在行中包含一个段落.现在我只需要Description中的第一行.我在Google中找不到它.请帮帮我...
In a table a column name is Discription that contain a Paragraph in row.Now I want only Top one Line from Description.I am not able to find it in Google.Pls help me...
推荐答案
我想您不想显示整个数据,而只显示某些字符,然后...
如果要执行此操作,请使用sql的Substring函数.
http://msdn.microsoft.com/en-us/library/ms187748.aspx [ ^ ]
请参见上面的链接.
谢谢,
Viprat
i think you do not want to show whole data but only some character and then ...
If you want to do this then use Substring function of sql.
http://msdn.microsoft.com/en-us/library/ms187748.aspx[^]
see the above link for example.
Thanks,
Viprat
在您的段落中正确包含标点符号,然后可以将第一行上移至.
In your paragraph it contains punctuation marks correctly then you can take your first line upto .
select substring(clo1,1,CHARINDEX('.', col1)) form tablename
这篇关于从数据库中拿出几句话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文