Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get rid of the rest of joined records?
Message
De
05/12/1997 17:48:07
Jeff Tucker
Mackinac Center For Public Policy
Midland, Michigan, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00064157
Message ID:
00064167
Vues:
26
>I have the remote view
>
>SELECT Pftenants.tn_key, Pftenants.tn_pfkey, Pftenants.tn_tekey,;
> Pftenants.tn_tenantname, Pftenants.tn_leaseterm,;
> Pftenants.tn_leaseexpiry, Pftenants.tn_area, Pftenants.tn_percrent,;
> Pftenrent.tr_rate, Pftenants.tn_spacetype,Pftenants.tn_dateentered,;
> Pftenrent.tr_startdate, Pftenants.tn_vacant;
> FROM dbo.PFTENANTS Pftenants, dbo.PFTENRENT Pftenrent;
> WHERE Pftenants.tn_key = Pftenrent.tr_tnkey;
> AND Pftenants.tn_pfkey = ?rv_pf.pf_key;
> ORDER BY Pftenants.tn_tenantname, ;
> Pftenrent.tr_startdate DESC
>
>which after the gives me several records for the same tenant with different rates. I need just first record of them. How I can get rid of others in one view definition?

If I understand what your asking I think I can help.

Below is a view in which the GROUP BY option for the SELECT command is used to Group the results by a unique ID, which means that they are only listed once in the result set.

SELECT Hours.cgroupid, Active.cproject, Active.caccount,;
Active.cactivity, Hours.ddate, SUM(Hours.ntime), Hours.chourid;
FROM projmain!hours INNER JOIN projmain!active ;
ON Hours.cgroupid = Active.cgroupid;
WHERE Hours.cempid = ?cPassID;
GROUP BY Hours.cgroupid

If you plan on changing data in the result set and sending the changes back to the server, I am not sure if my suggestion will help you.

Jeff
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform