Q&A

  • Group by에서 에러메세지 좀
이러한 에러 메세지가 발생되는데..



When GROUP BY exists, every simple field in projectors must be

in GROUP BY...



mCredit := '외상';

with FDATA.QARTICLE do

begin

Close;

Sql.Clear;

Sql.Add(' Select Num, Name, Article1, Article2, sum(Price) as Price, Credit, MDate, Bigo ');

Sql.Add(' From ARTICLE_SELL ');

Sql.Add(' where MDate >= "' + Trim(DateEdit3.Text) + '" ');

Sql.Add(' and MDate <= "' + Trim(DateEdit4.Text) + '" ');

Sql.Add(' where Credit = "' + mCredit + '" ');

Sql.Add(' and Name like "' + Trim(Edit3.Text) + '%" ');

Sql.Add(' Group by Credit ');

Sql.Add(' order by Name ');



Open;

end;



필드를 잘못 사용한건지..

2  COMMENTS
  • Profile
    방경주 2001.01.12 17:23
    Group By 절이 잘못 되었네여....



    Group By Num, Name, Article1, Article2, sum(Price) as Price, Credit, MDate, Bigo



    이렇게 함 해보세여....맞을라나? -_-;



    안된다면.....어찌되었건..Group by절이 잘못된거 같으니 거기서 찾아보셈~



    구럼 오늘두 즐푸~





    freelab wrote:

    > 이러한 에러 메세지가 발생되는데..

    >

    > When GROUP BY exists, every simple field in projectors must be

    > in GROUP BY...

    >

    > mCredit := '외상';

    > with FDATA.QARTICLE do

    > begin

    > Close;

    > Sql.Clear;

    > Sql.Add(' Select Num, Name, Article1, Article2, sum(Price) as Price, Credit, MDate, Bigo ');

    > Sql.Add(' From ARTICLE_SELL ');

    > Sql.Add(' where MDate >= "' + Trim(DateEdit3.Text) + '" ');

    > Sql.Add(' and MDate <= "' + Trim(DateEdit4.Text) + '" ');

    > Sql.Add(' where Credit = "' + mCredit + '" ');

    > Sql.Add(' and Name like "' + Trim(Edit3.Text) + '%" ');

    > Sql.Add(' Group by Credit ');

    > Sql.Add(' order by Name ');

    >

    > Open;

    > end;

    >

    > 필드를 잘못 사용한건지..

  • Profile
    델초보 2001.01.16 03:48
    Select 절에서 Group함수 - 여기서는 SUM이라는 것이 되겠군요... -를 제외한

    모든 필드를 Group By 절에 넣으셔야 합니다.

    그럼, 모든 문제는 깨끗이 해결.. ^^

    저도 초보때 요런 경험을 많이 했죠.. 쩝..

    알면 별것도 아닌데.. 20000







    방경주 wrote:

    > Group By 절이 잘못 되었네여....

    >

    > Group By Num, Name, Article1, Article2, sum(Price) as Price, Credit, MDate, Bigo

    >

    > 이렇게 함 해보세여....맞을라나? -_-;

    >

    > 안된다면.....어찌되었건..Group by절이 잘못된거 같으니 거기서 찾아보셈~

    >

    > 구럼 오늘두 즐푸~

    >

    >

    > freelab wrote:

    > > 이러한 에러 메세지가 발생되는데..

    > >

    > > When GROUP BY exists, every simple field in projectors must be

    > > in GROUP BY...

    > >

    > > mCredit := '외상';

    > > with FDATA.QARTICLE do

    > > begin

    > > Close;

    > > Sql.Clear;

    > > Sql.Add(' Select Num, Name, Article1, Article2, sum(Price) as Price, Credit, MDate, Bigo ');

    > > Sql.Add(' From ARTICLE_SELL ');

    > > Sql.Add(' where MDate >= "' + Trim(DateEdit3.Text) + '" ');

    > > Sql.Add(' and MDate <= "' + Trim(DateEdit4.Text) + '" ');

    > > Sql.Add(' where Credit = "' + mCredit + '" ');

    > > Sql.Add(' and Name like "' + Trim(Edit3.Text) + '%" ');

    > > Sql.Add(' Group by Credit ');

    > > Sql.Add(' order by Name ');

    > >

    > > Open;

    > > end;

    > >

    > > 필드를 잘못 사용한건지..