Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL SELECT on Cursors
Message
From
11/09/2001 08:24:35
 
 
To
10/09/2001 09:14:49
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00554562
Message ID:
00555074
Views:
18
Thanks you all for all your suggestions. I'm still new in VFP (I'm using VFP 6). I'm still learning. In my code I left something out. It should have been :

SELECT tempcur.clerk, COUNT(*);
FROM tempcur;
GROUP BY clerk;
INTO DBF output\entries

My code is running alright now. Thanks again. You guys are great!!!!

Cheers, Richard.

PS. And thanks a lot Cetin for pointing out that bit about GROUP BY and ORDER BY. It really made things easier for me.


>>
>>>Hi guys,
>>>Can you use SELECT SQL statement on cursors? I have a cursor called tempcur and I had this satement :
>>>
>>>SELECT tempcur.clerk, tempcur.rates;
>>> FROM tempcur;
>>> GROUP BY clerk;
>>> ORDER BY clerk;
>>> INTO DBF output/entries
>>>
>>>
>>>I get an error message "Invalid path or file name" when I run the form. What's wron with this? I would be glad of any help from you guys.
>>
>>Others have posted answers to this. I just have one question about the use of GROUP BY in your statement. Why are you using it?
>>
>>As Cetin posted, GROUP BY will implicitly do an ORDER BY. It needs to so it can roll up all the information based on clerk. However, because you don't have an aggregate function, it may mess up your results. If you have one entry per clerk, then the GROUP BY doesn't do anything for you except add extra processing time. If you have multiple entries per clerk, then you will get the rate for that clerk that is located last physically in the table (i.e. the rate record with the highest record number). You may or may not want that.
>
>How ignorant I can be :) Originally Renoir had the correct answer I think. His problem seems to stem from the fact that folder doesn't exist (my eyes simply ignored the message and dominated on title). Next ignorance there was no aggregate function there :)
>Cetin
Previous
Reply
Map
View

Click here to load this message in the networking platform