question

daniyalali2010 avatar image
daniyalali2010 asked

Finding Known State Changes in SQL

Hey,

Please see the columns below where the state moves from GOOD, BAD and UNDEFINED.


daterowstatus20/08/2022ZUNDEFINED19/08/2022ZUNDEFINED18/08/2022ZUNDEFINED17/08/2022ZUNDEFINED16/08/2022ZBAD15/08/2022ZGOOD14/08/2022ZGOOD13/08/2022ZGOOD



Now see the column below where the state skips the BAD state and goes directly to UNDEFINED.

04/08/2022ZUNDEFINED03/08/2022ZUNDEFINED02/08/2022ZUNDEFINED01/08/2022ZUNDEFINED31/07/2022ZGOOD30/07/2022ZGOOD29/07/2022ZGOOD28/07/2022ZGOOD



How can i detect the date on which the state entered UNDEFINED from GOOD. i.e my result should give me 01/08/2022 and the row Z.


Thanks.

selectsqlquery
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.