Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Union and Group by clause
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Union and Group by clause
Divers
Thread ID:
01457617
Message ID:
01457617
Vues:
98
Hi all,

i want a single sql command .
I WANT count a field of 2 tables with union clause

I want 2 for result of ncount() && {^2009/10/01}
 m.d_debut = {^2009/10/01}

  CREATE CURSOR Temp1 ( Ch1 D(8) )

  INSERT INTO Temp1  VALUE( m.d_debut )
  INSERT INTO Temp1  VALUE(m.d_debut + 1 )
  INSERT INTO Temp1  VALUE(m.d_debut + 2 )
  INSERT INTO Temp1  VALUE(m.d_debut + 3 )


  CREATE CURSOR Temp2 ( Ch1 D(8) )
  INSERT INTO Temp2  VALUE( m.d_debut )

  SET ENGINEBEHAVIOR 90
  SELECT Temp1.Ch1 ,;
    COUNT(Temp1.Ch1) AS NCOUNT  GROUP BY 1 FROM Temp1;
    UNION;
    SELECT Temp2.Ch1,;
    COUNT(Temp2.Ch1) AS NCOUNT  FROM Temp2;
    GROUP BY 1 INTO CURSOR temp
The result is bad...
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform