查询的一些例子:1.queryhive> SELECT name,subordinates[0] FROM employees;John Doe Mary SmithMary Smith Bill KingTodd Jones NULL2.expressionhive> SELECT upper(n...
分类:
其他好文 时间:
2015-05-15 17:13:32
阅读次数:
111
一、 ROWID的概念存储了row在数据文件中的具体位置:64位 编码的数据,A-Z, a-z, 0-9, +, 和 /,row在数据块中的存储方式SELECT ROWID, last_name FROM hr.employees WHERE department_id = 20;比 如:OOOOO...
分类:
数据库 时间:
2015-05-14 13:48:54
阅读次数:
226
使用变量作为数组索引请参见范例
范例
$ cat employees
Tom Jones 4424 5/12/66 543354
Mary Adams 5346 11/4/63 28765
Sally Chang 1654 7/22/54 650000
Billy Black 1683 9/23/44 336500
$ awk '{name[x++]=$...
分类:
编程语言 时间:
2015-05-07 08:52:42
阅读次数:
180
(1)交叉连接(cross join)即我们所说的笛卡尔积。查询出满足两张表所有的记录数,A(3条记录),B(9条记录),A*B(27条记录)。比如:雇员表(HR.employees)和货运公司(Sales.shippers)表做一个交叉连接。1 select * from hr.employee....
分类:
数据库 时间:
2015-05-05 18:47:20
阅读次数:
166
The Employee table holds all employees. Every employee has an Id, a salary, and there is also a column for the department Id....
分类:
其他好文 时间:
2015-05-02 09:50:00
阅读次数:
165
The Employee table holds all employees including their managers. Every employee has an Id, and there is also a column for the manager Id....
分类:
其他好文 时间:
2015-05-01 17:28:53
阅读次数:
124
先来看看几个LINQ to SQL的几个函数。
Take
说明:获取集合的前n个元素;延迟。即只返回限定数量的结果集。
var q = (
from e in db.Employees
orderby e.HireDate
select e)
.Take(5);
语句描述:选择所雇用的前5个雇员。
Skip
...
分类:
编程语言 时间:
2015-04-30 10:46:16
阅读次数:
174
题目The Employee table holds all employees. Every employee has an Id, a salary, and there is also a column for the department Id.
Id
Name
Salary
DepartmentId 1
Joe
70000
1
2
Henry
80...
分类:
其他好文 时间:
2015-04-25 12:17:23
阅读次数:
166
为了讨论索引策略,需要一个数据量不算小的数据库作为示例。本文选用MySQL官方文档中提供的示例数据库之一:employees。这个数据库关系复杂度适中,且数据量较大。下图是这个数据库的E-R关系图(引用自MySQL官方手册):下载文件后使用下面的语句将数据库导入:
tar -xjf $HOME/Downloads/employees_db-full-1.0.4.tar.bz2 //解压缩,进入...
分类:
数据库 时间:
2015-04-22 22:17:17
阅读次数:
156
PreparedStatement pstmt = con.prepareStatement("UPDATE EMPLOYEES SET SALARY = ? WHERE ID = ?"); pstmt.setBigDecimal(1, 153833.00) pstmt.setInt(2, 1105...
分类:
数据库 时间:
2015-04-22 13:38:08
阅读次数:
362