Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Result without group by
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Divers
Thread ID:
01032051
Message ID:
01032054
Vues:
21
Hi Robert,

> I do not want to use command like select sum(pen).

SUM() is probably not a good function, but I can't see why you would rule out MAX(). In SQL there is no concept of the "first record", since it's set based. If MAX(Pen), and so forth, cannot be used, the best solution would be to create a cursor and use a SCAN loop. Skip through the table and copy field values only if the field for this month in the cursor is still empty. Something like:
SELECT Table1
SCAN
  SELECT Cursor
  LOCATE FOR Month=Table1.Month
  IF NOT FOUND()
    INSERT INTO Cursor (Month) VALUES (Table.Month)
  ENDIF
  IF NOT EMPTY(Table.Pen) and EMPTY(Cursor.Pen)
    REPLACE NEXT 1 Pen WITH Table1.Pen
  ENDIF
ENDSCAN
--
Christof
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform