help with comparisons

  •  

    can some one help me i hate a table that has a matched pair number

    ie..

    icqrm006520050406142936mxfs100100985-ddpgw000020041209004511mxfs100088798

    icqrm006520050406142936mxfs100100995-ddpgw000020041209004512mxfs100088328

    icqrm006520050406142936mxfs100100995-icqrm006520050406142936mxfs100100995

     

    and im trying to put that in to a new table but before it goes to the new table i want to delete the matched pair where the number on the left side of the dash is exaclty equal to the number on the right side of the dash

  • Nicklous...there're many ways to skin this cat...here's one:

    DELETE FROM TABLE WHERE LEFT('icqrm006520050406142936mxfs100100995-icqrm006520050406142936mxfs100100995',(CHARINDEX('-', 'icqrm006520050406142936mxfs100100995-icqrm006520050406142936mxfs100100995', 1)-1))

    =

    RIGHT('icqrm006520050406142936mxfs100100995-icqrm006520050406142936mxfs100100995',(CHARINDEX('-', 'icqrm006520050406142936mxfs100100995-icqrm006520050406142936mxfs100100995', 1)-1))







    **ASCII stupid question, get a stupid ANSI !!!**

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

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