Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP60- SELECT DISTINCT
Message
From
27/08/1999 15:01:26
 
 
To
27/08/1999 14:45:15
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00257019
Message ID:
00258585
Views:
23
Morys,

The sample provided looks VERY much like a cut/paste of an ACCESS select statement. VFP doesn't have DISTINCTROW and VFP doesn't end in a semicolon.

Cheers,

Jim N

>Hello Hugo,
>
>Is this VFP 6.0? I have tried to figure out how to use this code but no luck yet.
>
>#1. Is the "First" a function?
>#2. What about DISTINCTROW? I don't see this anywhere in the sintax for SELECT-SQL command.
>#3. The semicolon at the end of the command is not right also, looks like something is missing at the end.
>
>Can you verify this code and re-send it? Thank you again.
>
>
>>>>SELECT DISTINCTROW First(CALLS.User_Name) AS [User_Name Field], Count(CALLS.User_Name) AS NumberOfDups
>>>>FROM CALLS
>>>>GROUP BY CALLS.User_Name
>>>>HAVING (((Count(CALLS.User_Name))>1));
>
>
>>>Hello Hugo,
>>>Is there something missing in this code? I see a semi-colon at the end of the code. Can you re-send please? Thank you again.
>>>
>>>>>SELECT DISTINCT * FROM ACCOUNTS gives me the non dup records from my accounts table. How do I get the dups using the same command? Is there something like SELECT NOT DISTINCT * FROM ACCOUNTS?
>>>>>
>>>>>Any suggestions or comments will be welcome, thank you.
>>>>
>>>>This is one sample SQL statement I'm using in a project and works fine.
>>>>
>>>>Hugo
>>>>
>>>>===========
>>>>SELECT DISTINCTROW First(CALLS.User_Name) AS [User_Name Field], Count(CALLS.User_Name) AS NumberOfDups
>>>>FROM CALLS
>>>>GROUP BY CALLS.User_Name
>>>>HAVING (((Count(CALLS.User_Name))>1));
>>
>>Morys,
>>
>>this works, it uses agregate functions to do so. What is does is select any record where the calls.user_name field is repeated more than once (for example, Administrator) and lists it with the number of times it shows up. It can also be used to checked on multiple fields for uniqueness.
>>
>>Hugo
Previous
Reply
Map
View

Click here to load this message in the networking platform