一.demo splice: 该方法会改变自动原始数组长度 实例: var array = ["aa","dd","cc","aa"]; //方法2:删除数组元素 array.splice(1,1); //输出结果:["aa","cc","aa"] getArray(array); 输出:aa cc aa 数组长度自动减一 二.实际业务场景中 在for循环中使y用 t
mysql 自定义函数,生成 n 个字符长度的随机字符串 -- sql function delimiter $$ create function rand_str(n int) returns VARCHAR(255) BEGIN declare str VARCHAR(100) DEFAULT 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSQUVWXYZ'; declare i int DEFAULT 0; declare res_str VAR
正常查询语句中TOP的运用: SELECT TOP 1000 * FROM MP_MemberGrade 随意更新一张表中满足条件的前N条数据: UPDATE TOP (1) MP_Member SET FKGradeID=2 WHERE IsDeleted=2 更新A表中满足B表前N条记录的数据 UPDATE MP_Member SET FKGradeID=2 FROM MP_Member A LEFT JOIN (SELECT TOP 10 * FROM MP_MemberGrade