Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select * from web_adm_gateway_concurrent_calls_start_value('2012-01-01 00:00:00'::timestamptz);
- CREATE OR REPLACE FUNCTION web_adm_gateway_concurrent_calls_start_value(p_date_start timestamp with time zone)
- RETURNS bigint AS
- $BODY$
- DECLARE i_count integer;
- BEGIN
- i_count := (SELECT COUNT(*) FROM cdr
- WHERE p_date_start BETWEEN sqltime AND sqltime_end
- AND gateway_id IS NOT NULL);
- RETURN i_count;
- END;
- $BODY$
- LANGUAGE plpgsql;
- SELECT COUNT(*) FROM cdr
- WHERE '2012-01-01 00:00:00'::timestamptz BETWEEN sqltime AND sqltime_end
- AND gateway_id IS NOT NULL
Add Comment
Please, Sign In to add comment