Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Select with Group by and Order by
Message
From
28/04/2010 09:46:55
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 6 SP5
Miscellaneous
Thread ID:
01462119
Message ID:
01462333
Views:
45
>>>In VFP9 you can combine two of them into one using derived tables.
>>
>>Yes but as I said no need to combine.
>>
>>>
>>>In VFP6:
>>>
>>>select max(Master_ind) as Master_Ind, Master_Code, count(*) as RecCount from myTable T1
>>>where Master_Ind = 'Y' or not exists(select 1 from myTable T where T.Master_Code  = T1.Master_Code and Master_Ind = 'Y')
>>>group by Master_Code
>>
>>How would this do what he wants? Even if it did (I don't think it would but thinking if it were right) then can you really have an updateable view out of this???
>>
>>Cetin
>
>I also don't think he can make an updatable view of this (this request left me puzzled last night). I just wanted to show a way to add the extra count column to the original query in VFP6.

OK setting updatable view aside, still I can't see how that query would do what he wants?
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform