Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help with SQL statement
Message
De
22/12/2003 22:14:24
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
22/12/2003 22:08:23
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00861465
Message ID:
00861479
Vues:
17
The OR approach will work too, of course. However, I think that simply counting the "valid" fields is simpler syntax - and easier to extend to any number of columns.

>
>select * from MyTable;
>  where iif(q1a > 2, 1, 0) + iif(q1b, 1, 0);
>    + iif(q1c, 1, 0) + iif(q1d, 1, 0) >= 2;
>  or iif(q2a > 2, 1, 0) + iif(q2b, 1, 0);
>    + iif(q2c, 1, 0) + iif(q2d, 1, 0) >= 2;
>  into cursor temp
>
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform