I have a table in sql server as follows:
table
-----
c_id unique_id text issue_type
---- --------- ---- ------
4 1 service changed ... servicechange
4 2 validation for service change validation
5 3 service changed servicechange
5 4 validation for service change validation
6 5 service changed servicechange
7 6 some other text ......
i want to pull service changed row only if it has a validation row for it. validation row could be immediately following the service change row .... or it could be some rows after the service change row... and also it may be absent for a particular service change row.
i can pull the service changed rows like this:
select * from table where issue_type = 'validation'