会员
众包
新闻
博问
闪存
赞助商
Trae
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
子夜的流星
博客园
首页
新随笔
联系
订阅
管理
2021年7月27日
js中数组排序
摘要: //数组排序 let arr2 = [3, 5, 1, 7, 9]; arr2.sort(); console.log(arr2); //倒叙排序1 arr2.reverse(); console.log(arr2); //倒叙排列2 arr2.sort((a,b)=>(b-a)); console
阅读全文
posted @ 2021-07-27 21:36 子夜的流星
阅读(175)
评论(0)
推荐(0)
2020年9月26日
字符串应该如何创建索引?
摘要: 场景一,根据邮箱登录是一个普遍场景,如果邮箱不加索引则需要全表扫描,而如果加入全量索引则需要占用很大的空间。由于字符串索引支持最左前缀原则,则我们可以这样创建索引: alter table user add index index(email(5)); 这里设置email的最左前5个字符作为索引可以
阅读全文
posted @ 2020-09-26 16:24 子夜的流星
阅读(1115)
评论(0)
推荐(0)
mysql索引覆盖与回表
摘要: 新建一张表: CREATE TABLE `r` ( `id` int NOT NULL primary key auto_increment, `k` int not null, `name` varchar(16), index(k)) ENGINE=InnoDB DEFAULT CHARSET=
阅读全文
posted @ 2020-09-26 16:17 子夜的流星
阅读(179)
评论(0)
推荐(0)
2020年7月8日
call_user_func的使用
摘要: <?php function demo01($a) { echo $a; } call_user_func("demo01", "hello world"); 输出 1.配合命令行参数使用 <?php //把第一个参数做为回调参数使用 $i = getopt("i:"); $i = $i['i'];
阅读全文
posted @ 2020-07-08 11:49 子夜的流星
阅读(377)
评论(0)
推荐(0)
2019年12月21日
mysql 分区表
摘要: 1.创建分区表 CREATE TABLE `fs_orders_funds_detail_sp32` ( `id` int(11) NOT NULL AUTO_INCREMENT, `confirm_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:
阅读全文
posted @ 2019-12-21 17:23 子夜的流星
阅读(918)
评论(0)
推荐(0)
php策略模式实现简单计算器
摘要: html: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>策略模式</title> </head> <body> <form action='./demo03.php' method="post"> <in
阅读全文
posted @ 2019-12-21 16:57 子夜的流星
阅读(263)
评论(0)
推荐(0)
2019年12月5日
PHP 可变参数
摘要: <?php //php 可变参数 function concatenate( ...$strings): string { $string = ''; //此时的strings 是一个数组 foreach($strings as $piece) { $string .= $piece; } retu
阅读全文
posted @ 2019-12-05 11:56 子夜的流星
阅读(749)
评论(0)
推荐(0)
2019年12月4日
php7新特性
摘要: 1.返回值类型的声明 <?php //php7新特性 返回值类型的声明 function arraySum (array $arr): array { return array_map(function($value){ return array_sum($value); }, $arr); } v
阅读全文
posted @ 2019-12-04 19:22 子夜的流星
阅读(128)
评论(0)
推荐(0)
2019年11月28日
mysql中sum与if,case when 结合使用
摘要: 1.sum与if结合使用 如图:数据表中,count_money 字段可为正,可为负。为正表示收入,负表示支出。 统计总收入,总支出。 select sum(if(count_money > 0, count_money, 0)) as sum_receipt, sum(if(count_money
阅读全文
posted @ 2019-11-28 19:15 子夜的流星
阅读(4362)
评论(0)
推荐(0)
2019年8月22日
linux查看进程与结束进程
摘要: 查看所有进程 ps -ef ps -ef | grep 查找的进程名 结束进程 ps -ef | grep 查找的进程名 | grep -v grep | awk '{print $2}' | xargs kill -9
阅读全文
posted @ 2019-08-22 17:36 子夜的流星
阅读(1594)
评论(0)
推荐(0)
下一页
公告
点击右上角即可分享