leetcode数据库sql之Department Top Three Salaries
2015-08-04 22:56
633 查看
leetcode原文引用:
How would you print just the 10th line of a file?
For example, assume that
Your script should output the tenth line, which is:
我的sql语句如下:
How would you print just the 10th line of a file?
For example, assume that
file.txthas the following content:
Line 1 Line 2 Line 3 Line 4 Line 5 Line 6 Line 7 Line 8 Line 9 Line 10
Your script should output the tenth line, which is:
Line 10
我的sql语句如下:
SELECT d.name as department, e.name,e.salary FROM Employee e JOIN Department d ON e.departmentid = d.id and (SELECT COUNT(DISTINCT (salary)) FROM Employee WHERE departmentid = e.departmentid AND salary > e.salary ) < 3 ORDER BY d.id ASC , e.salary DESC
相关文章推荐
- pl/sql develop Command Windows 命令
- FreeBSD 下 MySQL 安装与基本维护
- Mysql在大型网站的应用架构演变
- Mysql在大型网站的应用架构演变
- GO-数据类型protobuf-go-mysql
- Mysql主从架构集群部署
- 利用pl/sql developer进行远程连接oracle server出现的问题及解决办法
- ORACLE TOPsql
- SQL--delete、drop、truncate的区别
- SQL--delete、drop、truncate的区别
- SQL--delete、drop、truncate的区别
- 单表扫描,MySQL索引选择不正确 并 详细解析OPTIMIZER_TRACE格式
- Mysql 性能监控及调优
- mysql : Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf16_general_ci,IMPLICIT) for operation '
- MySQL的limit在SQLServer2008 中用top实现
- Mysql高性能维护
- The database principal owns a schema in the database, and cannot be dropped. (.Net SqlClient Data Pr
- mysql架构由小变大的演变过程
- sql 高级 (一) (top子句 like 通配符 IN between )
- SqliteDatabase之SqliteOpenHelper_封装方法