I have a query which works against SQL Server and I need to run it against DB2 version 7 from a C program.
Here's the query from SQL Server:
------------------------------------------------
Insert into appropsdistinct
select distinct acode, right(pcode,3),catcode, fundcode, left(objectcode,1), sum(summaryvalue),0,0,0
from dob_bps
group by (acode + right(pcode,3) + catcode + fundcode + left(objectcode,1)), acode, right(pcode,3),catcode, fundcode, left(objectcode,1)
---------------------------------------
I think this version of DB2 will support the right and left string functions and the select from...into;
I just don't know how to write the group by so that db2 will understand.
(actually i was hoping someone could explain that group by..)
Thanks in Advance
John
Here's the query from SQL Server:
------------------------------------------------
Insert into appropsdistinct
select distinct acode, right(pcode,3),catcode, fundcode, left(objectcode,1), sum(summaryvalue),0,0,0
from dob_bps
group by (acode + right(pcode,3) + catcode + fundcode + left(objectcode,1)), acode, right(pcode,3),catcode, fundcode, left(objectcode,1)
---------------------------------------
I think this version of DB2 will support the right and left string functions and the select from...into;
I just don't know how to write the group by so that db2 will understand.
(actually i was hoping someone could explain that group by..)
Thanks in Advance
John