How do I write a function in plpgsql that compares a date with a timestamp without time zone?
问题 I want to write a function that returns a table with all the rows between firstDate and lastDate . The rows have datatype timestamp without time zone They also have to be of a specific node id. This is my function: CREATE OR REPLACE FUNCTION get_measurements_by_node_and_date(nodeID INTEGER, firstDate date, lastDate date) RETURNS TABLE (measurement_id INTEGER, node_id INTEGER, carbon_dioxide DOUBLE PRECISION, hydrocarbons DOUBLE PRECISION, temperature DOUBLE PRECISION, humidity DOUBLE