mysql
林林剑
这个作者很懒,什么都没留下…
展开
-
Leetcode176. Second Highest Salary
Write a SQL query to get the second highest salary from the Employee table.+—-+——–+ | Id | Salary | +—-+——–+ | 1 | 100 | | 2 | 200 | | 3 | 300 | +—-+——–+ For example, given the above原创 2017-06-30 00:55:21 · 172 阅读 · 0 评论 -
mysql group by 之前进行排序
mysql 从表中找出某一列不重复的数据,并且按照时间找出最早的一条记录。select * from(select * from order by 时间 asc) agroup by a.某列目前只想到这种写法原创 2017-06-29 23:26:06 · 4858 阅读 · 4 评论 -
Leetcode177. Nth Highest Salary
Write a SQL query to get the nth highest salary from the Employee table.+—-+——–+ | Id | Salary | +—-+——–+ | 1 | 100 | | 2 | 200 | | 3 | 300 | +—-+——–+ For example, given the above Em原创 2017-06-30 01:08:54 · 230 阅读 · 0 评论 -
Leetcode182. Duplicate Emails
Write a SQL query to find all duplicate emails in a table named Person.+—-+———+ | Id | Email | +—-+———+ | 1 | a@b.com | | 2 | c@d.com | | 3 | a@b.com | +—-+———+ For example, your query shou原创 2017-07-02 23:45:20 · 169 阅读 · 0 评论 -
Leetcode183. Customers Who Never Order
Suppose that a website contains two tables, the Customers table and the Orders table. Write a SQL query to find all customers who never order anything.Table: Customers.+—-+——-+ | Id | Name | +—-+——-原创 2017-07-03 00:10:59 · 240 阅读 · 0 评论 -
Leetcode596. Classes More Than 5 Students
There is a table courses with columns: student and classPlease list out all classes which have more than or equal to 5 students.For example, the table:+———+————+ | student | class | +———+————+原创 2017-07-14 00:19:17 · 1382 阅读 · 0 评论 -
Leetcode197. Rising Temperature
Given a Weather table, write a SQL query to find all dates’ Ids with higher temperature compared to its previous (yesterday’s) dates.+———+————+——————+ | Id(INT) | Date(DATE) | Temperature(INT) | +———原创 2017-07-14 00:20:56 · 322 阅读 · 0 评论