Have you considered creating a view on the customers table called
preferred_customers?
--
Richard Armstrong
State Of The Art Consulting, Inc.
http://www.stateoart.com
PMG <pete_g_at_2xtreme.net> wrote in message
news:37399F81.7C81C9A2_at_2xtreme.net...
> I am trying to replace queries with complicated where clauses such as
> select count(*) from customers where fieldA = 'a' and fieldB = 'b'
> or fieldC = 'c' ...
>
> with a stored function somehow, so that the query would read as
> select count(*) from customers where Is_Preferred_Customer
>
> Can someone give me pointers or some sample code on how to to this?
> Should I pass the customer_id to the function Is_Preferred_Customer?
>
> TIA
>
> Pete
>
Received on Wed May 12 1999 - 11:28:28 CDT