Hi Friends ,
I have two table like log table and main table as below
LOG TABLE
IDPREVSTATUSCURR STATUS
1NULL Open
1Open Pending
1Pending Open
1Open OpenRequest
1OpenRequestClosed
MAIN TABLE
IDPREVSTATUSCURR STATUSMATCHID
1 Open Open NULL
1 Open Open 100
1 Pending Pending 101
1 Open Open 102
1 Open OpenRequest 103
1 Closed Closed 104
1 Closed Closed 104
1 Closed Closed 106
and i want the result like
RESULTIDMATCHID
1NULL
1101
1102
1103
1104
How it come means for first record null to open from log table(ie. start so matchid is null )
second record is open in prev stage and pending in current stage so match id is 101)
Like that i have to take result. Please help me in this.