Skip to content

How to change datatype of column with data

Let’s say I have a table call_log that has a column named duration. Let’s further pretend that when I put the table together, I made the mistake of making duration a varchar column instead of a number….

Stored procedure to return count

I am trying to make a stored procedure for the query I have: or I have written this stored procedure but it returns count of all the records in column not the result of query plus I need to write stored procedure in plpgsql not in SQL. Help me write this type of stored procedure in plpgsql which returns retur…