SHARE
TWEET

ZAD2

a guest May 22nd, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -KOLOKWIUM II GR II Z FB
  2. -
  3. --ZAD2
  4.  
  5. CREATE OR REPLACE FUNCTION zad2 (IIMIE OUT MECHANICY.IMIE%TYPE, NNAZWISKO OUT MECHANICY.NAZWISKO%TYPE) RETURN NUMBER IS ILOSC NUMBER(10,2)
  6.  
  7. BEGIN
  8.  
  9. CURSOR CUR IS SELECT COUNT(*) cos, MECHANICY.IMIE, MECHANICY.NAZWISKO
  10. FROM(
  11.     SELECT DISTINCT FROM MECHANICY
  12.     INNER JOIN NAPRAWY USING (ID_MECH)
  13.     WHERE MECHANICY.IMIE = IIMIE AND
  14.     MECHANICY.NAZWISKO = NNAZWISKO
  15.     GROUP BY MECHANICY.IMIE, MECHANICY.NAZWISKO
  16.     ORDER BY cos DESC
  17.     FETCH FIRST ROW ONLY;
  18.    
  19. );
  20. BEGIN
  21. OPEN CUR;
  22. FETCH CUR INTO INTO ILOSC, IIMIE, NNAZWISKO;
  23. CLOSE CUR;
  24. RETURN ILOSC;
  25.  
  26. END;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top