On Sat, 4 Jun 2022 at 22:56, Thiemo Kellner
wrote:
> Hi Robert
>
> Interesting problem. I need to think about it.
>
> You need to figure out when Input changes. You can achieve this by using
> lead or lag (depending of the sort direction over start)
> https://www.postgresql.org/docs/current/funct
Hi,
I have time series data from multiple inputs with start and
end timestamps.
Can anyone suggest an elegant way to coalesce consecutive rows so only the
first start time and last end time for each group of events (by input) is
returned.
Sample from and to below where the rows for Input number
On Tue, 3 May 2022 at 08:39, David G. Johnston
wrote:
> You basically have to use "INSERT ... RETURNING" or variables. Which/how
> depends on the language you are writing in. Pure SQL without client
> involvement requires that you use chained CTEs of INSERT...RETURNING (or I
> suppose you could
Hi,
When doing an insert with a serial primary key we can refer to
currval('sequence_name') in subsequent inserts and we also return it for
later processing.
Example:
CREATE TABLE contact (
contactid serial not null primary key, -- creates sequence
'contact_contactid_seq'
firstname text n