December 2, 2024 at 7:21 pm
I have a table dbo.tblPresentationStatus (sql script attached - table script.txt)
I have to select rows where the status change is wrong. (not as per the correct flow as shown in attached image status_Flow.jpg)
From 'Review' the status for a specific presentation ID can change to either 'Approve' or 'Presentation' or 'Close'
From 'Approve' the status for a specific presentation ID can change to either 'Presentation' or 'Close'
From 'Presentation' the status for a specific presentation ID can change to only 'Close'
I want to write query to return Presentations with wrong status flow. So expected output as per records given in script attached should be :
PrID | Status1 | Status2 | Status3 | Status 4
103 | REVIEW | PRESENTATION | APPROVE |CLOSE
101 | APPROVE | REVIEW | NULL | NULL
December 2, 2024 at 7:25 pm
Why are you re-posting the same q?
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
December 2, 2024 at 7:32 pm
The expected output is different in this case thats why.
Table structure is also different. Hence posted as a new question.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply