MySQL Forums
Forum List  »  Newbie

Re: Identify the start and end of a process.
Posted by: Peter Brawley
Date: March 30, 2017 11:12AM

It's a recursive row-to-row query. If you have MariaDB 10.2.2 or later, a recursive common table expression (CTE) will make the job easy. MySQL 8.0 will have CTEs in usable form, when we don't know.

Absent those possibilities, for how to do it in SQL see "Find sequence starts and ends" at https://www.artfulsoftware.com/queries.php for three algorithms you can use.

Or, you can suck the table into a buffer using a language API like PHP, and process it. Given adequate language skills, that's often the quickest solution.

Options: ReplyQuote


Subject
Written By
Posted
Re: Identify the start and end of a process.
March 30, 2017 11:12AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.