Subject | Re: conditional where clause |
---|---|
Author | crebegea74 |
Post date | 2006-12-19T13:34:32Z |
--- In firebird-support@yahoogroups.com, "Ivan Prenosil"
<Ivan.Prenosil@...> wrote:
with you (I `ve forgotten all about it).
Cornel Rebegea.
<Ivan.Prenosil@...> wrote:
>Table.field =
> > How can you make a conditional where clause in Firebird ?
> > I will give you an example of what I am used to do in Foxpro:
> >
> > Select *
> > from Table
> > where iif(:pcond, Table.field = :par1, True)
> >
> > that is, if param pcond is true than inforce condition
> > :par1, else no filter.Thanks, a no brainer after all, and sorry for not being on the spot
>
> What type is pcond ? If it contains 0/1 for true/false, then use
>
> where :pcond=0 or Table.field = :par1
>
> Ivan
>
with you (I `ve forgotten all about it).
Cornel Rebegea.