Answer the question
In order to leave comments, you need to log in
How to write an iterator function?
Postgresql
There is a table with the structure:
terms:
id SERIAL
term VARCHAR(40)
freq BIGINT
It is necessary to write a function that takes a value as a parameter with the same type as the term column. And if there is an entry with such a value, increase its freq value by 1. If there is no such entry, create it and set the freq value to 1.
You need to return the freq value.
It is assumed that a unique index and records are hung on the table and there are no identical term values.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question