• chirag ~ (9/2/2013)


    i have a table with one binary column. that contains 0x00010100000101010101......00 column datalength is 35040, i am prepare this data like

    @Jobbyte = COALESCE(@Jobbyte , 0x) + Cast ((Case When Sum(A.bit) >= 1 then 1 else 0 end)as binary(1))

    i have to compare this binary data with another binary data and get the matching binary count. both the binary data has equal length of data

    Please look below image, their is 2 binary data Binary1 and Binary2 i want to compare both binary data and get Sum of matching binary data. only one condition is when binary2's single bit is 0x01

    Last Row is indicate 0 = No Match, 1 = Match and last column is Sum of Last row (4) Please suggest me how can i compare , it's better if you can post a query

    Please see the first "Helpful Link" in my signature line below. You don't have to post a 35KByte binary but a couple of dozen bytes would be helpful.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)