hello,<div>I am trying to create a function, but instead of returning me all the rows from a table, it is just returning me count of rows</div><div>I don't understand whats wrong.</div><div>Please guide me</div><div><br>
</div><div>here's my code:</div><div><br></div><div><div>CREATE or REPLACE FUNCTION DEMO(latitude double precision, longitude double precision)</div><div>RETURNS TABLE (Tmsgcount bigint,utc_time double precision) as $$</div>
<div>BEGIN</div><div><br></div><div>create temporary table Transmitter as select count(msgno) TransCount,floor(utc_time) Trans_time from transmitter_primary where </div><div>st_dwithin(st_geogfromtext('SRID=4326;POINT(' || longitude || ' ' || latitude || ')'),geog,10)='t' group by floor(utc_time) order by floor(utc_time);</div>
<div><br></div><div>RETURN QUERY select * from Transmitter;</div><div><br></div><div>END;</div><div>$$ LANGUAGE plpgsql;</div></div><div><br></div><div><br></div><div>and it returns me just this value</div><div>13034;</div>