On Tue, 21 May 2002, David Shields wrote:
> Probably a very simple one for you guys, but I'm stuck.
> Given a simple table (events):
> idint
> sttime not null
> ettime not null
>
> I know I can get duration by converting st and et to secs and subtracting
> (that bits easy), but how
You could join the table against itself, matching each row against every
following record and then summarizing to find the "next" one. If your table
is of a fair size, you'd need to play with the optimizer to make sure you
get the efficiency you need. The SQL would be along the lines of:
select m