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

Thread: Oracle "Is true" function???

  1. #1
    Join Date
    Mar 2004
    Location
    Upper Marlboro, MD
    Posts
    4

    Oracle "Is true" function???

    I was wondering if there is a sql function that returns TRUE or FALSE for a sub-select statement. For example...

    Select * from customer where customer_id = 4 AND IsTrue(Select registered from customer where customer = 'y')


    I realize that is not the best example because there are a several other ways to figure out such a query without an "IsTrue" function, but it is just an example of what type of function that I'm looking for. Thanks.
    ~anthony

  2. #2
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    Check the docs for EXISTS...
    Jeff Hunter

  3. #3
    Join Date
    Mar 2002
    Location
    Mesa, Arizona
    Posts
    1,204
    Select *
    from customer.c1
    where c1.customer_id = 4
    and exists (Select 'x'
    from customer.c2
    where c1.customer_id = c2.customer_id
    and = ccustomer = 'y')

    Seems to me that this would do the same thing:
    select *
    from customer
    where customer_id = 4
    and ccustomer = 'y'
    "I do not fear computers. I fear the lack of them." Isaac Asimov
    Oracle Scirpts DBA's need

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