Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Help Needed Please!
Message
From
24/08/2001 12:48:09
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00548100
Message ID:
00548793
Views:
16
>>Sorry. It gives me the error: "Cannot GROUP by aggregate field"
>>
>>I appreciate the effort though. :)
>
>Kevin,
>
>Did I ask you to quote message? :) My colleague tested it and it worked fine. Ok, here is her test, you need to use your field names:
>
>1.
>select  min(divnumb) as f ,div.compnumb, ;
>compname from div ;
>join comp on div.compnumb=comp.compnumb ;
>group by div.compnumb into dbf min
>2.
>select iif(min.f=divnumb,min.compname,space(30)) as compnumer, ;
>divnumb, divname ;
>from div left join min ;
>on (min.f=div.divnumb and min.compnumb=div.compnumb)
>
>I then realized, that there is no need to make join in the first select, so it might be simplified.
>
>So, please, show me the code, you're replying to, I let you know, where is a mistake.
>
>BTW, I don't see your appreciation :)

Nadya,
It was a slight typo in group by 1.
'Best' is attractive there :) I suspect a nonSQL approach might be longer in code but faster.
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