Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
FROM
abcd.QVD (qvd)
WHERE EXISTS (Flag)
AND [field1] <> 'XYZ'
AND field2 <> 'PQRS'
Group by
cal_key,
mat_key,
cus_key,
sdo,
Flag
;
I included all fields in the group by.
without group by it works fine. But When I use group by along with two AND conditions, its failing to run.
Also, It works fine when I use "group by" and remove the two 'AND" conditions.
I am using aggregations in the load statement.
Please help.
Message was edited by: Prithvi K
An added requirement for using the GROUP BY clause is that all fields listed in the GROUP BY clause should also appear - without aggregation functions - in the column list of the LOAD statement. Otherwise the group by makes no sense: should it create a single output record because there are no differing characteristics in the group by result set? Or should it create multiple records that have no identifying field values of their own?
Best,
Peter
Nothing about the portion of the load statement you show is jumping out at me, but clearly that's not your actual load statement. It would be much easier to debug your code if you showed us the actual code that has the bug. Also, what does "failing to run" mean? You get an error? What error?
Any reason why you don't show the LOAD statement with the fields you are loading?
Do field1 and field2 exist in your QVD?
Do cal_key, mat_key, cus_key, sdo and Flag exist in your QVD?
What error message do you get?
yes the field1 and field2 exist in QVD
somehow its running fine now. Thanks very much for looking into this. Really appreciate your responses.
However, my posts doesn't get posted unless the moderator approves it. Not sure why this happens.