摘要:
select d.Name Department, e1.Name Employee, e1.Salary from Employee e1 join Department d on e1.DepartmentId = d.Id where 3 > (select count(distinct(e2.Salary)) from Employee e2 ... 阅读全文
摘要:
SELECT dep.Name as Department, emp.Name as Employee, emp.Salary from Department dep, Employee emp where emp.DepartmentId=dep.Id and emp.Salary=(Select max(Salary) from Employee e2 where e2.Departm... 阅读全文
摘要:
Select DISTINCT l1.Num from Logs l1, Logs l2, Logs l3 where l1.Id=l2.Id-1 and l2.Id=l3.Id-1 and l1.Num=l2.Num and l2.Num=l3.Num 阅读全文
摘要:
class Solution { public String largestNumber(int[] nums) { String[] arr=new String[nums.length]; for(int i=0;i{return new String(b+a).compareTo(a+b);}); if(arr[0].charAt(0... 阅读全文
摘要:
SELECT Score, (SELECT count(distinct Score) FROM Scores WHERE Score >= s.Score) Rank FROM Scores s ORDER BY Score desc 阅读全文
摘要:
CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT BEGIN DECLARE M INT; SET M=N-1; RETURN ( # Write your MySQL query statement below. SELECT DISTINCT Salary FROM Employee ORDER BY S... 阅读全文
摘要:
class Solution { public int calculateMinimumHP(int[][] dungeon) { if(dungeon.length==0||dungeon[0].length==0) return 0; int M=dungeon.length; int N=dungeon[0].... 阅读全文
摘要:
/** * Definition for binary tree * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ public class BSTIterator { ... 阅读全文