SQL Server matching using like

  • hi all,

    quick question

    given the following data

    ABC - xxxxxx

    DEF - xxxxxx

    XXY - aaaaaa

    aaa-ddd-fgg

    whats the best way of pulling out all the data

    except for

    ABC - xxxxxx

    DEF - xxxxxx

    ??

    cheers

    Ads


    ------------------------------
    Life is far too important to be taken seriously

  • SELECT * FROM tbl WHERE col not like 'ABC%' and COL not like 'DEF%'

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    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
  • ok thanks..i had a feeling that was the best way to go..i thought maybe there is a more elegant solution but thats fine

    thanks !


    ------------------------------
    Life is far too important to be taken seriously

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

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