Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to GROUP BY ON 2 fields in SQL
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01362746
Message ID:
01362840
Views:
23
>>>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform