Re: GROUP BY Clause Problem in VFP8

From: Fred Taylor (ftaylor_at_mvps.org!REMOVE)
Date: 10/16/04


Date: Sat, 16 Oct 2004 16:22:58 -0700

VFP 8's SQL has been brought more into line with the the SQL standard. This
is correct operation of a SQL statement, though if you've gotten used to
VFP's earlier incorrect usage, it may not seem so.

So tell me, which ssn goes with which checkname in your select? It's
ambiquous.

You can do SET ENGINEBEHAVIOR 70 to have it work in the old style, or you
can aggregate your ssn field with either a MIN or a MAX function. I do
believe that MAX(ssn) will give you the same results as previous versions of
VFP.

-- 
Fred
Microsoft Visual FoxPro MVP
"Steve Meyerson" <stevemeyerson@cox.net> wrote in message 
news:i453n0l3j9q98mi10mb18iggr4qbe5tj8m@4ax.com...
> The following worked fine in VFP6:
>
> SELECT CheckName, Ssn ;
>  FROM Payroll ;
>  INTO TABLE TempPay ;
>  GROUP BY CheckName
>
> In VFP8 I get the error msg:
>
> SQL: GROUP BY clause is missing or invalid
>
> even when I ran it from the command window.
>
> It will work ok  if I SELECT only one field instead of 2 or more, but
> that's not acceptable.
>
> Payroll is a free dbf.  I tried copying Payroll.dbf to "convert" it in
> case that was necessary. I also created a simple dbf in VFP8 and got
> the same behavior.
>
> Any clue what's going on? Thanks for any help.
>
>
> Steve Meyerson
>
> 


Relevant Pages

  • Re: Adding a UNIQUE constraint
    ... create view MyView ... create unique clustered index C_MyView on MyView (SSN) ... Columnist, SQL Server Professional ... from dbo.MyTable go create unique clustered index C_MyView on MyView go -- ...
    (microsoft.public.sqlserver.programming)
  • Re: VB6.0 - Data Format
    ... > SSN for each record or writing a module to handle it? ... This would be soooo much easier in SQL Server, just UPDATE mytable SET ssn = ... reasons I don't do Jet, ... >> automatically make the format of the data in that column consistent. ...
    (microsoft.public.vb.database)
  • Re: creating a primary key on peoples names??
    ... creating a function that will create a unique ID etc SQL ... Why would I use a function when an Identity key can create ... Perhaps last_name plus first_name plus ssn is what we will use...or ...
    (microsoft.public.sqlserver)
  • Re: Need a So-Called SSN Encryption
    ... I have a SQL 2000 table with Social security numbers. ... allowed to use the exact SSN, we need to add 1 to each number in the ... the new SSN would be the new Member ID. ... State what version of SQL Server you are using and specify the content ...
    (comp.databases.ms-sqlserver)
  • Re: Import into existing rows
    ... I need my query to look at the SSN from the Notes database and insert the approperiate date fields to the corrisponding date columns in my table. ... >If it would be easier to explain, you can use an example that would take the data from one sql table to another. ... Using proprietary Transact-SQL syntax (more compact, probably faster, ...
    (microsoft.public.sqlserver.programming)