Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Reg - Log table data


Reg - Log table data

Author
Message
vinodhkumargv
vinodhkumargv
Grasshopper
Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)

Group: General Forum Members
Points: 13 Visits: 87
Hi Friends ,

I have two table like log table and main table as below

LOG TABLE
ID PREVSTATUS CURR STATUS
1 NULL Open
1 Open Pending
1 Pending Open
1 Open OpenRequest
1 OpenRequest Closed

MAIN TABLE
ID PREVSTATUS CURR STATUS MATCHID
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

RESULT ID MATCHID
1 NULL
1 101
1 102
1 103
1 104

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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search