presentations/highlight-js/test/detect/pgsql/default.txt

14 lines
320 B
Text
Raw Normal View History

2018-12-07 08:48:05 -06:00
BEGIN;
SELECT sum(salary) OVER w, avg(salary) OVER w
FROM empsalary
WINDOW w AS (PARTITION BY depname ORDER BY salary DESC);
END;
CREATE FUNCTION days_of_week() RETURNS SETOF text AS $$
BEGIN
FOR i IN 7 .. 13 LOOP
RETURN NEXT to_char(to_date(i::text,'J'),'TMDy');
END LOOP;
END;
$$ STABLE LANGUAGE plpgsql;