View previous topic :: View next topic |
Author |
Message |
tcurrier Intermediate
Joined: 10 Feb 2006 Posts: 188 Topics: 68
|
Posted: Sat Jan 20, 2007 8:38 pm Post subject: SQL error at or before <EMPTY> ??? |
|
|
Can anyone tell me what the cause of the SQL error is below ?
Code: | SELECT CONCAT_KEY,
COUNT(*)
FROM (SELECT DIST_NUMBER||AGT_NUMBER||AGT_INDEX
AS CONCAT_KEY
FROM H2591DB.TCSAU_EVMA
WHERE STATE = '20'
AND GENERAL_STATUS = '1'
AND REASON_GENERAL IN ('A','B')
AND DIST_NUMBER = 'ERP')
GROUP BY CONCAT_KEY; |
QUERY MESSAGES:
SQL error at or before <EMPTY> (line 9, position 27).
QUERY MESSAGES:
SQL error at or before <EMPTY> (line 9, position 27). |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Sat Jan 20, 2007 9:39 pm Post subject: |
|
|
tcurrier,
You need to qualify the temp result table. Try this
Code: |
SELECT A.CONCAT_KEY
,COUNT(*)
FROM (SELECT DIST_NUMBER||AGT_NUMBER||AGT_INDEX
AS CONCAT_KEY
FROM H2591DB.TCSAU_EVMA
WHERE STATE = '20'
AND GENERAL_STATUS = '1'
AND REASON_GENERAL IN ('A','B')
AND DIST_NUMBER = 'ERP') A
GROUP BY A.CONCAT_KEY;
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
tcurrier Intermediate
Joined: 10 Feb 2006 Posts: 188 Topics: 68
|
Posted: Sat Jan 20, 2007 10:58 pm Post subject: |
|
|
Thank you very much ! I've used DB2/SQL before, but not with this combination of concatenated fields and the 'group by' clause. This one was driving me nuts.
Thanks again ! |
|
Back to top |
|
|
|
|