Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create or replace function pokazSwojeTowary() returns trigger
- language plpgsql
- as
- '
- DECLARE
- id int;
- pl int;
- BEGIN
- select kto_wypozyczyl FROM wypozyczenie into id ORDER BY data_wypozyczenia DESC limit 1;
- select co_wypozyczyl FROM wypozyczenie into pl ORDER BY data_wypozyczenia DESC limit 1;
- select tytul, cena from plyta where numer in (select co_wypozyczyl from wypozyczenie where kto_wypozyczyl=id);
- return null;
- end ';
- create trigger trwypozyczenie after insert on wypozyczenie for each statement execute procedure pokazSwojeTowary();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement