List:General Discussion« Previous MessageNext Message »
From:Martijn Tonies Date:November 19 2004 4:02pm
Subject:Re: detect rows that has zero values
View as plain text  
> > And since 0 is false and every other number is true,
> > this could be
> > simplified to
> >
> >    SELECT country
> >    FROM Rates
> >    WHERE fieldvalue1 AND fieldvalue2 AND fieldvalue3
> >    ORDER BY country;
> >
> > Michael
> >
> >
>
> I will go to bed less fool this evening... Is it just
> a clearest way to write it, or is there some
> performance issues too ?

Actually -- this isn't "clear" at all. It's the shortest
way, not the clearest.

It's most probably not portable too.

One might think that "fieldvalue1" is a boolean
column instead of a numeric one.

Personally, I would advise against such a query
it were to be coded for re-use or use in an application.

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com

Thread
detect rows that has zero valuesLouie Miranda19 Nov
  • Re: detect rows that has zero valuesdenys19 Nov
  • Re: detect rows that has zero valuesGleb Paharenko19 Nov
    • Re: detect rows that has zero valuesMichael Stassen19 Nov
      • Re: detect rows that has zero valuesSGreen19 Nov
        • Re: detect rows that has zero valuesMichael Stassen19 Nov
      • Re: detect rows that has zero valuesBulant Denys19 Nov
        • Re: detect rows that has zero valuesMichael Stassen19 Nov
        • Re: detect rows that has zero valuesMartijn Tonies19 Nov