Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I use vfp's min in a vfp sql statement?
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
How do I use vfp's min in a vfp sql statement?
Divers
Thread ID:
00310771
Message ID:
00310771
Vues:
84
I want to use the VFP min function in a sql statement, but it gives me an error, because the sql min function doesn't work the same. In this example, the second one works, but I am wondering if there is a faster way.

create table foo ( iFid1 i, iFid2 i )
insert into foo values (-1,-1)
insert into foo values (-1,1)
insert into foo values (1,-1)
insert into foo values (1,0)
insert into foo values (1,1)
insert into foo values (0,0)

select min( 0, iFid1 ) as iMin1, min( 0, iFid2) as iMin2 ;
from foo ;
having min( iMin, iMin2 ) < 0

select iif( ifid1<0, ifid1, 0 ) as iMin1, iif( iFid2<0, iFid2, 0 ) as iMin2 ;
from foo ;
having iMin1 < 0 or iMin2 < 0
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform