DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Oracle binary comparison

  1. #1
    Join Date
    Jan 2002
    Posts
    38

    Oracle binary comparison

    This question was given to me by one of our develpers. I'am not familar with this at all so any thing you can help out with. Thanks

    SQLServer lets me do this query:

    select * from myTable where x & 8 = 8

    x is a number column in myTable. This query does a logical comparison on the binary value of x. So, if x = 12 (binary 1100) then the result of x & 8 is 8. The result of x & 4 is 4. This is very nifty. I can't find a corresponding operator in oracle. Can you please check into it and see if oracle supports that kind of comparison.

    Does anybody know how I can do this is Oracle.

  2. #2
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    that's a binary AND operation, right?

    Documented in the SQL Reference here
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

  3. #3
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Originally posted by slimdave
    that's a binary AND operation, right?

    Documented in the SQL Reference here
    Perhaps the reason why BITAND function is so astonishingly unknown among Oracle comunity is to be attributed to the fact that it has not been documented in Oracle manuals for such a long time. Although it has been available and in use at least since early Oracle7, it has found its way into documentation only in 8.1.7 for the first time! Why they (Oracle Corp.) have been "hiding" this particular function for such a long time (while using it extensively themselves in data dictionary) will allways remain a mistery to me.
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width