Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to GROUP BY ON 2 fields in SQL
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01362746
Message ID:
01362840
Vues:
24
>>>>Thank you in advance.
>>>
>>>No way:( You can't create SQL that would work unchanged for VFP and SQL all the time. You are wasting your time trying to make it compatible IMHO. Write them depending on backend.
>>>Cetin
>>
>>If both fields are of character type, you can just group by each field individually. Otherwise I agree, we need back-end specific query.
>
>Why?
>Your first suggestion should works with both (or at least for VFP9):
>
>SELECT MyGrp
>FROM (SELECT Field1+Field2 AS MyGrp
>             FROM MyTable) Tbl1
>GROUP BY MyGrp
>
>
>:-)

I know, but I don't know if this is much of overhead in VFP.
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform