2019年1月16日
摘要: Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Example 1:Input: haystack = "hello", needle = 阅读全文
posted @ 2019-01-16 23:37 KissMe3Times 阅读(89) 评论(0) 推荐(0)
摘要: Given an array nums and a value val, remove all instances of that value in-place and return the new length. Do not allocate extra space for another ar 阅读全文
posted @ 2019-01-16 20:22 KissMe3Times 阅读(86) 评论(0) 推荐(0)
摘要: Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length. Do not allocate extra spa 阅读全文
posted @ 2019-01-16 17:47 KissMe3Times 阅读(149) 评论(0) 推荐(0)
  2019年1月6日
摘要: case 具有两种形式:简单case函数和case搜索函数 以leetcode题目为例:将sex列中所有的female(f)换成male(m): UPDATE salarySET sex = CASE sex WHEN 'm' THEN 'f' ELSE 'm' END; 其中简单case函数就是 阅读全文
posted @ 2019-01-06 22:28 KissMe3Times 阅读(124) 评论(0) 推荐(0)
摘要: UPDATE 表名称 SET 列名称 = 新值 WHERE 列名称 = 某值 这个没什么好说的 不过搭配 one single update之后遇到一道题,其中用到case when then的语法 阅读全文
posted @ 2019-01-06 21:45 KissMe3Times 阅读(71) 评论(0) 推荐(0)
  2019年1月4日
摘要: 用法实例:limit 4 offset 9 代表从第10行开始,第11, 12, 13行, 一共四行。其中limit 表示显示几行,offset表示从哪一行的下一行开始。所以limit 1 offset 1 就是第二行的值。 阅读全文
posted @ 2019-01-04 18:29 KissMe3Times 阅读(240) 评论(0) 推荐(0)
摘要: ifnull()的原型为 ifnull(expr1, expr2), 如果expr1不是NULL时则返回expr1,如果epxr1是NULL时则返回expr2。如果写 IFNULL(expr1, NULL)的话则将可以避免expr1为NULL时的输出错误。 阅读全文
posted @ 2019-01-04 17:46 KissMe3Times 阅读(85) 评论(0) 推荐(0)
摘要: group by() 一般和 count(), sum(), avg() 三种聚合函数一起使用才有意义,而且可以多字段使用。例如: SELECT Customer, SUM(OrderPrice) FROM Orders GROUP BY Customer order by() 列 ASC(默认升序 阅读全文
posted @ 2019-01-04 17:25 KissMe3Times 阅读(115) 评论(0) 推荐(0)
  2019年1月3日
摘要: on条件是在生成临时表时使用的条件,它不管on中的条件是否为真,都会返回左边表中的记录。 where条件是在临时表生成好后,再对临时表进行过滤的条件,这时已经没有left join和含义,条件不为真的就全部过滤掉。 on 和 left join / right join / inner join / 阅读全文
posted @ 2019-01-03 21:57 KissMe3Times 阅读(166) 评论(0) 推荐(0)
  2018年12月13日
摘要: JAVA中文件名与类名之间的关系是什么? C语言动态和静态分配内存的具体解释是什么? JAVA的句柄,C++的引用,C的指针都是有什么区别和联系? 数组定义在栈中,实际存储在堆中是什么意思? 什么是字面值? malloc和new的区别 复制构造函数 操作符重载 函数重载的条件是什么? 虚拟内存是什么 阅读全文
posted @ 2018-12-13 14:21 KissMe3Times 阅读(62) 评论(0) 推荐(0)