11.07.2015 Views

Oracle Database 11 g - Online Public Access Catalog

Oracle Database 11 g - Online Public Access Catalog

Oracle Database 11 g - Online Public Access Catalog

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

536 CHAPTER 12 ■ DATA WAREHOUSINGVIDEO_NAMERENTAL_TYPE_XML------------------ --------------------------------------------Walk the Line 100005500The Pacifier 100007500Superman Returns 1000020000....In this particular example, the output will display data only where a valid rental type transactionexists. Sometimes, the preferable situation may be to use a subquery in pivot_in_clauseto retrieve the data. In this case, instead of using the any keyword, you can replace pivot_in_clause with the query select distinct rental_type from rental_types, as shown here:SQL> select *from (select video_name, rental_type, quantity_rentedfrom video_mstr_vw)pivot xml (sum(quantity_rented)for rental_type in (select distinct rental_type from rental_types) )order by video_name desc/VIDEO_NAMERENTAL_TYPE_XML-------------------- --------------------------------------------Walk the Line 1000055001000<strong>11</strong>000210003

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!