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

Compare records in same table Expand / Collapse
Author
Message
Posted Friday, September 18, 2009 1:27 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, August 30, 2013 1:54 AM
Points: 39, Visits: 118
I have one table test where million of records.
The table is not having any primary column.
The columns in table are positionid,ID1,ID2,Event,DrC,Acct,Amount,
valuedate, and Ccyt.
There are lot of records for valuedate= 20070731 and 20070724. There are other valuedate also.
But i want to fetch all the different records except valuedate for these two value date (20070731 and 20070724) in table.

Please provide me query. I am using sql server 2005.
Post #790141
Posted Friday, September 18, 2009 6:14 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, November 13, 2012 5:18 AM
Points: 37, Visits: 166
isnt it " Where valuedate <>'20070731' and Valudate <>'20070724' ?

or i didnt get the question correct

Post #790313
Posted Friday, September 18, 2009 6:18 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 2:40 PM
Points: 12,880, Visits: 31,800
i'd do it almost the same as the thetodaisies,just changed it to be ready for more dates to exclude:

valuedate NOT IN('20070731','20070724' )


Lowell

--There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #790315
Posted Friday, September 18, 2009 6:21 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 6:20 AM
Points: 1,904, Visits: 2,823
Lowell (9/18/2009)
i'd do it almost the same as the thetodaisies,just changed it to be ready for more dates to exclude:

valuedate NOT IN('20070731','20070724' )


Question is a bit fague, but I must agree with Lowell here.


----------------------------------------------
Msg 8134, Level 16, State 1, Line 1
Divide by zero error encountered.
Post #790317
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse