By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,558 Members | 1,060 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,558 IT Pros & Developers. It's quick & easy.

a query at db2

P: n/a
I 'm new at db2,I wrote a query which doesn't run at spufi:

------------------------
select distinct grade.gradecode,
((pamt+lvby+clal+poal+mhal)-(select distinct (pamt+lvby+clal+poal+mhal)
from grade as g where g.gradecode=
(select max(gradecode) from grade as g2 where g2.gradecode<grade.gradecode
and g2.empno=grade.empno)))

as ExcessSum from grade
------------------------
the error is :
ILLEGAL SYMBOL "GRADECODE". SOME SYMBOLS THAT MIGHT BE LEGAL ARE: + ) -
42601 SQLSTATE RETURN CODE
------------------------
tnx in advanced

--
Message posted via http://www.dbmonster.com
Nov 12 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
"Maryam S via DBMonster.com" <fo***@nospam.DBMonster.com> wrote in message
news:31******************************@DBMonster.co m...
I 'm new at db2,I wrote a query which doesn't run at spufi:

------------------------
select distinct grade.gradecode,
((pamt+lvby+clal+poal+mhal)-(select distinct (pamt+lvby+clal+poal+mhal)
from grade as g where g.gradecode=
(select max(gradecode) from grade as g2 where g2.gradecode<grade.gradecode
and g2.empno=grade.empno)))

as ExcessSum from grade
------------------------
the error is :
ILLEGAL SYMBOL "GRADECODE". SOME SYMBOLS THAT MIGHT BE LEGAL ARE: + ) -
42601 SQLSTATE RETURN CODE
------------------------
tnx in advanced

You need to start out by looking at the SQL Reference manual. You can
download it here:
http://www-306.ibm.com/software/data...s/v7books.html

Other versions are also available, since you didn't specify which version
you are using.
Nov 12 '05 #2

P: n/a

it's DB2 ver7 as I got I can't use nested query,yes?

--
Message posted via http://www.dbmonster.com
Nov 12 '05 #3

P: n/a
"Maryam S via DBMonster.com" <fo***@DBMonster.com> wrote in message
news:ac******************************@DBMonster.co m...

it's DB2 ver7 as I got I can't use nested query,yes?

There are multiple things wrong with your query. Check the SQL reference
manual. You can search it with Acrobat reader.
Nov 12 '05 #4

P: n/a
I can run it at SQl but when I want to run it at DB2 it doesn't I think
there is sth which DB2 doesn't support.

--
Message posted via http://www.dbmonster.com
Nov 12 '05 #5

P: n/a
"Maryam S via DBMonster.com" <fo***@DBMonster.com> wrote in message
news:0a******************************@DBMonster.co m...
I can run it at SQl but when I want to run it at DB2 it doesn't I think
there is sth which DB2 doesn't support.

Are you talking about MS SQL Server? That is a different product, that
rarely follows ANSI SQL standards. Check out the DB2 SQL Reference manual.
Nov 12 '05 #6

P: n/a
tnx Mark for ur help.

--
Message posted via http://www.dbmonster.com
Nov 12 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.