- 博客(0)
- 资源 (3)
- 收藏
- 关注
db2物化路径模型查询
-- 物化路径模型
-- 自顶到底的查询
SELECT a.materialized_path, a.commander, a.description
FROM t_materialized_model AS a, t_materialized_model AS b
WHERE a.materialized_path LIKE CONCAT(b.materialized_path, '%') AND b.description = '雨恬' order by materialized_path
-- 自底到顶的查询
SELECT a.materialized_path, a.commander, a.description
FROM t_materialized_model AS a, t_materialized_model AS b
WHERE b.materialized_path LIKE CONCAT(a.materialized_path, '%') AND b.description = '雨恬'
-- 嵌套集合模型
-- description, commander,left_number,rightf_number
SELECT a.left_number,a.right_number, a.commander, a.description
FROM t_nested_model AS a, t_nested_model AS b
WHERE a.left_number between b.left_number, b.right_number and b.description = '雨恬' ORDER BY left_number
2012-01-30
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人