Hi everybody.
I am working on a query where SYSCAT.COLUMNS is part of the join and the
output:
colname colno generate_unique _val
a 1 100000000000000
a 1 100000000000001
a 1 100000000000002
b 2 100000000000003
b 2 100000000000004
b 2 100000000000005
c 3 100000000000006
c 3 100000000000007
c 3 100000000000008
expected result:
a 1 100000000000000
b 2 100000000000003
c 3 100000000000006
a 1 100000000000001
b 2 100000000000004
c 3 100000000000007
a 1 100000000000002
b 2 100000000000005
c 3 100000000000008
SELECT ROW_NUMBER() OVER(PARTITION BY COLNAME) AS RN did the trick on my
home
computer with DB2 9.5c express.
But i don't have OLAP functions at work. How to do this partition without
using OLAP.
Generete Unique gave me the row number.
Programmer life is much easier when you have such tool like OLAP.
Thank's in advance Lenny G.
--
Message posted via DBMonster.com
I am working on a query where SYSCAT.COLUMNS is part of the join and the
output:
colname colno generate_unique _val
a 1 100000000000000
a 1 100000000000001
a 1 100000000000002
b 2 100000000000003
b 2 100000000000004
b 2 100000000000005
c 3 100000000000006
c 3 100000000000007
c 3 100000000000008
expected result:
a 1 100000000000000
b 2 100000000000003
c 3 100000000000006
a 1 100000000000001
b 2 100000000000004
c 3 100000000000007
a 1 100000000000002
b 2 100000000000005
c 3 100000000000008
SELECT ROW_NUMBER() OVER(PARTITION BY COLNAME) AS RN did the trick on my
home
computer with DB2 9.5c express.
But i don't have OLAP functions at work. How to do this partition without
using OLAP.
Generete Unique gave me the row number.
Programmer life is much easier when you have such tool like OLAP.
Thank's in advance Lenny G.
--
Message posted via DBMonster.com