Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
View
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Re: View
Divers
Thread ID:
01165282
Message ID:
01165368
Vues:
17
>Borislav,
>
>a another way...
>
>( I m not a super king in sql script !...:)
>
>I think that subquery is possible in xcase ...
>
>
>CREATE CURSOR Employee ( Iid I  )
>  CREATE CURSOR Contrat_l ( Iid I  , iemployeeiD I , ddebut D(8) , dfin D(8) )
>
>  FOR x = 1 TO 60
>    INSERT INTO Employee VALUES (x)
>  ENDFOR
>
>  m.lDCurrentDate = DATE()
>
>  INSERT INTO Contrat_l VALUES ( 1 , 4 , {^2005/03/18}, {^2005/09/15} )
>  INSERT INTO Contrat_l VALUES ( 2 , 14 , {^2001/06/13}, {^2006/01/12} )
>  INSERT INTO Contrat_l VALUES ( 3 , 14 , {^2007/01/12}, {} )
>  INSERT INTO Contrat_l VALUES ( 4 , 22 , {^2003/01/12},  {^2003/09/12} )
> INSERT INTO Contrat_l VALUES ( 5 , 22 , {^2004/01/12},  {^2006/11/12} )
>
>
>  SET ENGINEBEHAVIOR 90
>
>  SELECT Employee.Iid,;
>    ( SELECT NVL( Contrat_l.iemployeeiD , 0 ) AS 'test'  FROM Contrat_l LET JOIN ;
>    Employee.Iid = Contrat_l.iemployeeiD GROUP BY Contrat_l.iemployeeiD ) FROM Employee
>
>
>
>I have a strange group by error ...
>
>
>bernhart



No, you can't use a subquery that way. When you use subquery in fields section of SELECT that subquery must return only one record. Also that kind of queries are slower than others because that subquery runs for every record of the main query
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform