mrlonelyjtr's blog

写BUG的程序猿


  • Home

  • Categories

  • Archives

  • Tags

  • Search

【SQL进阶教程】让SQL飞起来

Posted on 2019-09-15 | In SQL
不管是减少排序还是使用索引,抑或是避免中间表的使用,都是为了减少对硬盘的访问。 使用高效的查询在SQL中,很多时候不同代码能够得出相同结果。从理论上来说,得到相同结果的不同代码应该有相同的性能,但遗憾的是,查询优化器生成的执行计划很大程度上要受到代码外部结构的影响。 参数是子查询时,使用EXISTS ...
Read more »

【SQL进阶教程】HAVING子句又回来了

Posted on 2019-09-13 | In SQL
整理一下在调查集合性质时经常用到的条件。这些条件可以在HAVING子句中使用,也可以通过SELECT子句在CASE表达式里使用。 各队,全体点名需要做的是查出现在可以出勤的队伍。可以出勤即队伍里所有队员都处于“待命”状态。使用的是下面这张表。 1234567-- 谓词SELECT team_id ...
Read more »

[LintCode] Problem 617 - Maximum Average Subarray II

Posted on 2019-09-12 | In Algorithm , LintCode
Given an array with positive and negative numbers, find the maximum average subarray which length should be greater or equal to given length k. NoteIt ...
Read more »

[LeetCode] Problem 643 - Maximum Average Subarray I

Posted on 2019-09-12 | In Algorithm , LeetCode
Given an array consisting of n integers, find the contiguous subarray of given length k that has the maximum average value. And you need to output the ...
Read more »

[LeetCode] Problem 522 - Longest Uncommon Subsequence II

Posted on 2019-09-11 | In Algorithm , LeetCode
Given a list of strings, you need to find the longest uncommon subsequence among them. The longest uncommon subsequence is defined as the longest subs ...
Read more »

[LeetCode] Problem 521 - Longest Uncommon Subsequence I

Posted on 2019-09-11 | In Algorithm , LeetCode
Given a group of two strings, you need to find the longest uncommon subsequence of this group of two strings. The longest uncommon subsequence is defi ...
Read more »

The English We Speak 3

Posted on 2019-09-11 | In English
In black and whiteit’s official - it’s been printed or written down - so there is no dispute! ExamplesI have it here in black and white - I’ve got the ...
Read more »

【SQL进阶教程】用SQL处理数列

Posted on 2019-09-10 | In SQL
生成连续编号思考一下如何使用SQL生成连续编号。例如生成0~99这100个连续编号。首先生成一张存储了各个数位上数字的表“数字表”。 这样,就可以通过对两个Digits集合求笛卡尔积而得出0~99的数字。 1234SELECT D1.digit + (D2.digit * 10) AS seqFR ...
Read more »

【SQL进阶教程】EXISTS谓词的用法

Posted on 2019-09-09 | In SQL
谓词是一种特殊的函数,返回值是真值。谓词逻辑提供谓词是为了判断命题的真假。参数是行数据的集合。在EXISTS的子查询里,SELECT子句的列表可以有下面这三种写法。 通配符:SELECT * 常量:SELECT ‘这里的内容任意’ 列名:SELECT col 在SQL中,为了表达全称量化,需要将 ...
Read more »

[LeetCode] Problem 520 - Detect Capital

Posted on 2019-09-08 | In Algorithm , LeetCode
Given a word, you need to judge whether the usage of capitals in it is right or not. We define the usage of capitals in a word to be right when one of ...
Read more »
1…121314…78
mrlonelyjtr

mrlonelyjtr

间歇性踌躇满志,持续性混吃等死

780 posts
18 categories
18 tags
Github
© 2020 mrlonelyjtr
Powered by Hexo
Theme - NexT.Pisces