Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Group by and count on union select
Message
 
 
À
08/05/2008 14:19:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01315922
Message ID:
01315923
Vues:
21
This message has been marked as the solution to the initial question of the thread.
>I have a union select like this:
>
>
select count(*) as MembersCount, NoMember, ;
Members.LastName, Members.FirstName from (
>SELECT Personal.NoMember FROM Personal;
> UNION;
>SELECT Personal.NoMember2 AS NoMember FROM Personal;
> UNION;
>SELECT Personal.NoMember3 AS NoMember FROM Personal) ;
InnerSQL inner join Members on InnerSQL.NoMember = Members.MemberID ;
group by NoMember, LastName, FirstName
>
>
>Now, I need to enhance that select so I can have a group by NoMember with the COUNT(*). And, I also need to INNER JOIN that to the Member table so I will be able to get the first name and last name.
>
>I am not sure about the proper syntax for that. I guess I will need to have some sub select.

You can use derived table. See corrections inline.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform