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.
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'
Bookmarks