Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Union and Group by clause
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Union and Group by clause
Miscellaneous
Thread ID:
01457617
Message ID:
01457617
Views:
97
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...
Next
Reply
Map
View

Click here to load this message in the networking platform