0

Sorry I'm pretty new on this i would like to run something like the code but without storing it, just output the data as i am a read only user in the database I want to run it. BTW i know that the code there is very simple. I just wanna know how to print the data as it is an example.

CREATE [OR REPLACE] FUNCTION a ()
RETURNS timestamp
LANGUAGE plpgsql   
AS $variable_name$     
DECLARE 
  time_a timestamp; 
BEGIN     
  SELECT facilitytime 
     INTO time_a 
  FROM metrics 
  ORDER BY facilitytime DESC 
  LIMIT 1;   

  RETURN time_a;
END;    
$$  
a_horse_with_no_name
  • 497,550
  • 91
  • 775
  • 843

0 Answers0