Shailrshah

Printing the Title and Price for Top 5 costliest Movies

Oct 27th, 2013
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PL/SQL 0.34 KB | None | 0 0
  1. DECLARE
  2.         CURSOR c    IS SELECT * FROM movie ORDER BY price DESC;
  3.         mPointer        c%ROWTYPE;
  4. BEGIN
  5.         OPEN c;
  6.         FETCH c INTO mPointer;
  7.         FOR i IN 1..5 LOOP
  8.                 DBMS_OUTPUT.put_line(mPointer.title||': '|| mPointer.price);
  9.                 FETCH c INTO mPointer;
  10.         END LOOP;
  11.         CLOSE c;
  12. END;
  13. /
Add Comment
Please, Sign In to add comment