Guest User

Untitled

a guest
Jul 8th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. select * from web_adm_gateway_concurrent_calls_start_value('2012-01-01 00:00:00'::timestamptz);
  3.  
  4. CREATE OR REPLACE FUNCTION web_adm_gateway_concurrent_calls_start_value(p_date_start timestamp with time zone)
  5.   RETURNS bigint AS
  6. $BODY$
  7.     DECLARE i_count integer;
  8. BEGIN
  9.  
  10.     i_count := (SELECT COUNT(*) FROM cdr
  11.             WHERE p_date_start BETWEEN sqltime AND sqltime_end
  12.             AND gateway_id IS NOT NULL);
  13.  
  14.     RETURN i_count;
  15. END;
  16. $BODY$
  17.   LANGUAGE plpgsql;
  18.  
  19. SELECT COUNT(*) FROM cdr
  20.             WHERE '2012-01-01 00:00:00'::timestamptz BETWEEN sqltime AND sqltime_end
  21.             AND gateway_id IS NOT NULL
Add Comment
Please, Sign In to add comment