Đang chuẩn bị liên kết để tải về tài liệu:
Joe Celko s SQL for Smarties - Advanced SQL Programming P61

Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG

Joe Celko s SQL for Smarties - Advanced SQL Programming P61. In the SQL database community, Joe Celko is a well-known columnist and purveyor of valuable insights. In Joe Celko's SQL for Smarties: Advanced SQL Programming, he picks up where basic SQL training and experience leaves many database professionals and offers tips, techniques, and explanations that help readers extend their capabilities to top-tier SQL programming. Although Celko denies that the book is about database theory, he nevertheless alludes to theory often to buttress his practical points. This title is not for novices, as the author points out. Instead, its intended. | 572 CHAPTER 24 REGIONS RUNS GAPS SEQUENCES AND SERIES AND I3.n 1 SELECT DISTINCT C1.x C1.y FROM Cover AS C1 WHERE NOT EXISTS SELECT FROM Cover AS C2 WHERE C2.x C1.x AND C2.y C1.y AND C1.x C2.x OR C1.y C2.y ORDER BY C1.x Finally try this approach. Assume we have the usual Sequence auxiliary table. Now we find all the holes in the range of the intervals and put them in a view or a with clause-derived table. CREATE VIEW Holes hole AS SELECT seq_nbr FROM Sequence WHERE seq_nbr SELECT MAX y FROM Intervals AND NOT EXISTS SELECT FROM Intervals WHERE seq_nbr BETWEEN x AND y UNION VALUES 0 left sentinel value UNION SELECT MAX y 1 FROM Intervals -- right sentinel value The query picks start and end pairs that are on the edge of a hole and counts the number of holes inside that range. Covering has no holes inside its range. SELECT Starts.x Ends.y FROM Intervals AS Starts Intervals AS Ends Sequence AS S -- usual auxiliary table WHERE S.seq_nbr BETWEEN Starts.x AND Ends.y -- restrict seq_nbr numbers AND S.seq_nbr SELECT MAX hole FROM Holes AND S.seq_nbr NOT IN SELECT hole FROM Holes -- not a hole 24.10 Coverings 573 AND Starts.x - 1 IN SELECT hole FROM Holes on a left cusp AND Ends.y 1 IN SELECT hole FROM Holes on a right cusp GROUP BY Starts.x Ends.y HAVING COUNT DISTINCT seq_nbr Ends.y - Starts.x 1 -- no .

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.