Compare records in same table

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

  • isnt it " Where valuedate '20070731' and Valudate '20070724' ?

    or i didnt get the question correct

  • 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


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

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

    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    This thing is addressing problems that dont exist. Its solution-ism at its worst. We are dumbing down machines that are inherently superior. - Gilfoyle

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply