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 3, 2024 at 9:59 am
It's not the same. The expected output is different in this case thats why. Table structure is also different. Hence posted as a new question.
Can you at least prove that you have attempted to solve this question, using one or more of the techniques provided previously? It does seem very similar to what has been asked before.
The absence of evidence is not evidence of absence.
Martin Rees
You can lead a horse to water, but a pencil must be lead.
Stan Laurel
December 3, 2024 at 12:18 pm
This was removed by the editor as SPAM
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply