Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- 7. Riadiaca struktura IF-THEN-ELSE
- CREATE OR REPLACE FUNCTION ifstat (date)
- RETURNS text
- AS
- $$
- BEGIN
- IF EXTRACT(DAY FROM current_date) = 1
- THEN
- RETURN '1st day of the Month';
- ELSE
- RETURN 'Other day';
- END IF;
- END;
- $$
- LANGUAGE plpgsql;
Advertisement
Add Comment
Please, Sign In to add comment