Notice (8): file_put_contents(): Write of 270 bytes failed with errno=28 No space left on device [CORE/src/Log/Engine/FileLog.php, line 140]

Notice: file_put_contents() [function.file-put-contents]: Write of 1108 bytes failed with errno=28 No space left on device in /www/wwwroot/www.adminso.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140
Notice (8): SplFileObject::fwrite() [<a href='https://secure.php.net/splfileobject.fwrite'>splfileobject.fwrite</a>]: Write of 5131 bytes failed with errno=28 No space left on device [CORE/src/Cache/Engine/FileEngine.php, line 141]

Notice: file_put_contents() [function.file-put-contents]: Write of 3152 bytes failed with errno=28 No space left on device in /www/wwwroot/www.adminso.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140
Notice (8): SplFileObject::fwrite() [<a href='https://secure.php.net/splfileobject.fwrite'>splfileobject.fwrite</a>]: Write of 5437 bytes failed with errno=28 No space left on device [CORE/src/Cache/Engine/FileEngine.php, line 141]

Notice: file_put_contents() [function.file-put-contents]: Write of 3152 bytes failed with errno=28 No space left on device in /www/wwwroot/www.adminso.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140
Notice (8): unserialize() [<a href='https://secure.php.net/function.unserialize'>function.unserialize</a>]: Error at offset 8159 of 8181 bytes [APP/Controller/NewsController.php, line 5571]

Notice: file_put_contents() [function.file-put-contents]: Write of 2395 bytes failed with errno=28 No space left on device in /www/wwwroot/www.adminso.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140
Notice (8): unserialize() [<a href='https://secure.php.net/function.unserialize'>function.unserialize</a>]: Error at offset 4076 of 4085 bytes [APP/Controller/NewsController.php, line 5571]

Notice: file_put_contents() [function.file-put-contents]: Write of 2488 bytes failed with errno=28 No space left on device in /www/wwwroot/www.adminso.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140
Notice (8): unserialize() [<a href='https://secure.php.net/function.unserialize'>function.unserialize</a>]: Error at offset 4076 of 4085 bytes [APP/Controller/NewsController.php, line 5571]

Notice: file_put_contents() [function.file-put-contents]: Write of 2488 bytes failed with errno=28 No space left on device in /www/wwwroot/www.adminso.com/vendor/cakephp/cakephp/src/Log/Engine/FileLog.php on line 140
SQLSubstring提取部分字符串 - 站长搜索
首页 > 资讯列表 > 编程/数据库 >> 数据库操作教程

SQLSubstring提取部分字符串

数据库操作教程 2022-09-23 16:54:35 转载来源: 网络整理/侵权必删

功能:返回字符、二进制、文本或图像表达式的一部分语法:SUBSTRING(expression,start,length)         SQL中的substring函数是用来抓出一个栏位资料中的其中一部分。这个函数的名称在不同的资料库中不完全一样:参数:expression字符串、二进制字符串、文本、图像、列或包含列的表达式

功能:返回字符、二进制、文本或图像表达式的一部分

语法:SUBSTRING ( expression, start, length )

          SQL 中的 substring 函数是用来抓出一个栏位资料中的其中一部分。这个函数的名称在不同的资料库中不完全一样:

参数:

expression 字符串、二进制字符串、文本、图像、列或包含列的表达式。请勿使用包含聚合函数的表达式。

start 整数或可以隐式转换为 int 的表达式,指定子字符串的开始位置。

length 整数或可以隐式转换为 int 的表达式,指定子字符串的长度。
返回值:

如果 expression 是一种支持的字符数据类型,则返回字符数据。如果 expression 是一种支持的二进制数据类型,则返回二进制数据。如果 start = 1,则子字符串从表达式的第一个字符开始。

返回字符串的类型与给定表达式的类型相同(下表所示内容除外)。

给定表达式返回类型

image

varbinary

ntext

nvarchar

代码示例:

下面的示例返回 Employees 表中每位雇员的名字首字母及完整姓氏:

SELECT SUBSTRING(First Name,1,1) AS Initial, Last Name
FROM Employees

下面是结果集:

Initial..........Last Name
-------------------------
A................Funk
M................Pearson
L................Calafato
N................Danner
J................Lee
S................Byham
M................Sutter
R................King
A................Doyle
  • MySQL: SUBSTR(), SUBSTRING()
  • Oracle: SUBSTR()
  • SQL Server: SUBSTRING()

标签: SQLSubstring 提取 部分 字符串


声明:本文内容来源自网络,文字、图片等素材版权属于原作者,平台转载素材出于传递更多信息,文章内容仅供参考与学习,切勿作为商业目的使用。如果侵害了您的合法权益,请您及时与我们联系,我们会在第一时间进行处理!我们尊重版权,也致力于保护版权,站搜网感谢您的分享!

站长搜索

http://www.adminso.com

Copyright @ 2007~2025 All Rights Reserved.

Powered By 站长搜索

打开手机扫描上面的二维码打开手机版


使用手机软件扫描微信二维码

关注我们可获取更多热点资讯

站长搜索目录系统技术支持