Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Group By

hi,

I have applied group by as:

A:

LOAD

     max(ShiftStartDate) as ShiftStartDate,

    max(ShiftEndDate) as ShiftEndDate,

      REF_AgentName,

        REF_acdId

   

FROM

D:\Qvd\Employee.qvd

(qvd) group by  REF_AgentName,REF_acdId;

Now there are more fields also which I want to fetch.

how can I add fields in table A from same qvd.

Thnks

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Use inner join to keep only records where the fields match in both tables:

LOAD

     max(ShiftStartDate) as ShiftStartDate,

    max(ShiftEndDate) as ShiftEndDate,

      REF_AgentName,

        REF_acdId

  

FROM

D:\Qvd\Employee.qvd

(qvd) group by  REF_AgentName,REF_acdId;

inner join

load Field1, Field2,....etc

from D:\Qvd\Employee.qvd (qvd);


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
sushil353
Master II
Master II

you can do a join to this table...with the main table

Not applicable
Author

If I am applying join in this than that will affecting my data.

Actually I want to :

REF_acdId according to max(date) only , so that only unique REF_acdId can come.

It is coming by using group by but if I apply join than duplicate REF_acdId is coming.

hope you are understanding the problem.

Gysbert_Wassenaar

Use inner join to keep only records where the fields match in both tables:

LOAD

     max(ShiftStartDate) as ShiftStartDate,

    max(ShiftEndDate) as ShiftEndDate,

      REF_AgentName,

        REF_acdId

  

FROM

D:\Qvd\Employee.qvd

(qvd) group by  REF_AgentName,REF_acdId;

inner join

load Field1, Field2,....etc

from D:\Qvd\Employee.qvd (qvd);


talk is cheap, supply exceeds demand
sushil353
Master II
Master II

Please post the sample data...