Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Reg - Log table data Expand / Collapse
Author
Message
Posted Monday, February 17, 2014 6:47 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, June 12, 2014 7:55 AM
Points: 12, Visits: 81
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



Post #1542085
Posted Monday, February 17, 2014 6:58 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 7:53 AM
Points: 42,822, Visits: 35,952
Duplicate. No replies to this please. Direct replies to http://www.sqlservercentral.com/Forums/Topic1542092-391-1.aspx


Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1542095
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse