- 论坛徽章:
- 11
|
早期的版本是NODENUMBER,现在都用DBPARTITIONNUM
For compatibility with previous versions of DB2, NODENUMBER can be specified in place of DBPARTITIONNUM.
Examples: v Count the number of instances in which the row for a given employee in the EMPLOYEE table is on a different database partition than the description of the employee’s department in the DEPARTMENT table.
SELECT COUNT(*) FROM DEPARTMENT D, EMPLOYEE E WHERE D.DEPTNO=E.WORKDEPT AND DBPARTITIONNUM(E.LASTNAME) <> DBPARTITIONNUM(D.DEPTNO)
Join the EMPLOYEE and DEPARTMENT tables so that the rows of the two tables are on the same database partition.
SELECT * FROM DEPARTMENT D, EMPLOYEE E WHERE DBPARTITIONNUM(E.LASTNAME) = DBPARTITIONNUM(D.DEPTNO) |
|