Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
檀越@新空间
Coding Tree
提交
34ec7ab9
C
Coding Tree
项目概览
檀越@新空间
/
Coding Tree
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
Coding Tree
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
34ec7ab9
编写于
5月 08, 2022
作者:
彭世瑜
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix
上级
517683aa
变更
5
展开全部
显示空白变更内容
内联
并排
Showing
5 changed file
with
468 addition
and
3 deletion
+468
-3
blog/mysq-advance/mysql-index.md
blog/mysq-advance/mysql-index.md
+420
-0
blog/php-mysql/index.md
blog/php-mysql/index.md
+1
-1
blog/php-mysql/sql-function.md
blog/php-mysql/sql-function.md
+11
-2
index.html
index.html
+35
-0
static/js/prism-python.min.js
static/js/prism-python.min.js
+1
-0
未找到文件。
blog/mysq-advance/mysql-index.md
浏览文件 @
34ec7ab9
此差异已折叠。
点击以展开。
blog/php-mysql/index.md
浏览文件 @
34ec7ab9
...
...
@@ -60,7 +60,7 @@
[
流程结构 if while
](
blog/php-mysql/sql-if-while.md
)
[
函数 function
](
blog/php-mysql/sql-function.md
)
[
内置函数和自定义
函数 function
](
blog/php-mysql/sql-function.md
)
[
存储过程 procedure
](
blog/php-mysql/sql-procedure.md
)
...
...
blog/php-mysql/sql-function.md
浏览文件 @
34ec7ab9
# 函数 function
#
内置函数和自定义
函数 function
函数分为两类:系统函数和自定义函数
...
...
@@ -19,9 +19,12 @@ length | 判断字符串的字节数,与字符集有关
concat | 连接字符串
insrt | 检查字符是否在目标字符串中,存在返回其位置,不存在返回 0
lcase | 全部小写
left | 左侧开始截取字符串,直到指定位置
ltrim | 消除左边的空格
left(str, length) | 左侧开始截取字符串,直到指定位置
right(str, length) | 右侧开始截取字符串,直到指定位置
mid | 从中间指定位置开始截取,如果不指定截取长度,直接到最后
`substring(str, index, [length]`
) | 从指定位置开始,指定截取长度
substring_index(str, delim, count) | 按照关键字截取
示例
...
...
@@ -39,9 +42,15 @@ select instr('你好中国', '我'); // 0
select
lcase
(
'aBcd'
);
//
abcd
select
left
(
'aBcd'
,
2
);
//
aB
select
right
(
'abcdef'
,
2
);
//
ef
select
substring
(
'abcdef'
,
2
,
3
);
//
bcd
select
substring
(
'abcdef'
,
-
2
,
3
);
//
ef
select
ltrim
(
' abc d '
);
//
abc
d
select
mid
(
'你好中国'
,
3
);
//
中国
select
substring_index
(
'www.baidu.com'
,
'.'
,
2
);
//
www
.
baidu
select
substring_index
(
'www.baidu.com'
,
'.'
,
-
2
);
//
baidu
.
com
```
### 1.2、时间函数
...
...
index.html
浏览文件 @
34ec7ab9
...
...
@@ -18,6 +18,15 @@
href=
"static/js/vue@4.12.2.min.css"
>
<style>
:root
{
--toc-width
:
300px
;
}
/* 左侧导航 */
.sidebar
{
width
:
220px
;
}
/* 更新时间 */
.last-update-time-wrap
{
padding
:
20px
0
;
...
...
@@ -33,7 +42,29 @@
/* 右侧目录 */
.page_toc
{
margin-top
:
20px
;
max-height
:
calc
(
100vh
-
100px
);
overflow-y
:
auto
;
/* height: 100px; */
}
.page_toc
::-webkit-scrollbar
{
width
:
4px
}
.page_toc
::-webkit-scrollbar-thumb
{
background
:
0
0
;
border-radius
:
4px
}
.page_toc
:hover::-webkit-scrollbar-thumb
{
background
:
hsla
(
0
,
0%
,
53.3%
,
.4
)
}
.page_toc
:hover::-webkit-scrollbar-track
{
background
:
hsla
(
0
,
0%
,
53.3%
,
.1
)
}
</style>
</head>
...
...
@@ -85,12 +116,16 @@
<script
src=
"static/js/prism-bash.min.js"
></script>
<script
src=
"static/js/prism-php.min.js"
></script>
<script
src=
"static/js/prism-sql.min.js"
></script>
<script
src=
"static/js/prism-python.min.js"
></script>
<script
src=
"static/js/prism-json@1.26.0.min.js"
></script>
<script
src=
"static/js/search@4.12.2.min.js"
></script>
<script
src=
"static/js/docsify-copy-code@2.1.1.min.js"
></script>
<script
src=
"static/js/time-updater@1.min.js"
></script>
<!-- 下载地址 -->
<!-- https://cdn.jsdelivr.net/npm/prismjs@1/components/prism-python.min.js-->
<link
rel=
"stylesheet"
href=
"static/js/toc.css"
>
<script
src=
"static/js/toc.js"
></script>
...
...
static/js/prism-python.min.js
0 → 100644
浏览文件 @
34ec7ab9
Prism
.
languages
.
python
=
{
comment
:{
pattern
:
/
(
^|
[^\\])
#.*/
,
lookbehind
:
!
0
,
greedy
:
!
0
},
"
string-interpolation
"
:{
pattern
:
/
(?:
f|fr|rf
)(?:(
"""|'''
)[\s\S]
*
?\1
|
(
"|'
)(?:\\
.|
(?!\2)[^\\\r\n])
*
\2)
/i
,
greedy
:
!
0
,
inside
:{
interpolation
:{
pattern
:
/
((?:
^|
[^
{
])(?:\{\{)
*
)\{(?!\{)(?:[^
{}
]
|
\{(?!\{)(?:[^
{}
]
|
\{(?!\{)(?:[^
{}
])
+
\})
+
\})
+
\}
/
,
lookbehind
:
!
0
,
inside
:{
"
format-spec
"
:{
pattern
:
/
(
:
)[^
:(){}
]
+
(?=\}
$
)
/
,
lookbehind
:
!
0
},
"
conversion-option
"
:{
pattern
:
/!
[
sra
](?=[
:}
]
$
)
/
,
alias
:
"
punctuation
"
},
rest
:
null
}},
string
:
/
[\s\S]
+/
}},
"
triple-quoted-string
"
:{
pattern
:
/
(?:[
rub
]
|br|rb
)?(
"""|'''
)[\s\S]
*
?\1
/i
,
greedy
:
!
0
,
alias
:
"
string
"
},
string
:{
pattern
:
/
(?:[
rub
]
|br|rb
)?(
"|'
)(?:\\
.|
(?!\1)[^\\\r\n])
*
\1
/i
,
greedy
:
!
0
},
function
:{
pattern
:
/
((?:
^|
\s)
def
[
\t]
+
)[
a-zA-Z_
]\w
*
(?=\s
*
\()
/g
,
lookbehind
:
!
0
},
"
class-name
"
:{
pattern
:
/
(\b
class
\s
+
)\w
+/i
,
lookbehind
:
!
0
},
decorator
:{
pattern
:
/
(
^
[\t
]
*
)
@
\w
+
(?:\.\w
+
)
*/m
,
lookbehind
:
!
0
,
alias
:[
"
annotation
"
,
"
punctuation
"
],
inside
:{
punctuation
:
/
\.
/
}},
keyword
:
/
\b(?:
_
(?=\s
*:
)
|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield
)\b
/
,
builtin
:
/
\b(?:
__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip
)\b
/
,
boolean
:
/
\b(?:
False|None|True
)\b
/
,
number
:
/
\b
0
(?:
b
(?:
_
?[
01
])
+|o
(?:
_
?[
0-7
])
+|x
(?:
_
?[
a-f0-9
])
+
)\b
|
(?:\b\d
+
(?:
_
\d
+
)
*
(?:\.(?:\d
+
(?:
_
\d
+
)
*
)?)?
|
\B\.\d
+
(?:
_
\d
+
)
*
)(?:
e
[
+-
]?\d
+
(?:
_
\d
+
)
*
)?
j
?(?!\w)
/i
,
operator
:
/
[
-+%=
]
=
?
|!=|:=|
\*\*?
=
?
|
\/\/?
=
?
|<
[
<=>
]?
|>
[
=>
]?
|
[
&|^~
]
/
,
punctuation
:
/
[
{}[
\]
;(),.:
]
/
},
Prism
.
languages
.
python
[
"
string-interpolation
"
].
inside
.
interpolation
.
inside
.
rest
=
Prism
.
languages
.
python
,
Prism
.
languages
.
py
=
Prism
.
languages
.
python
;
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录