
07-07-09, 09:42
|
|
Registered User
|
|
Join Date: Jul 2009
Location: NY
Posts: 886
|
|
Quote:
|
Originally Posted by Peter.Vanroose
Or slightly shorter:
Code:
WITH
n(n) AS (VALUES 2,3,5,7,13,17,19,31,61,89,107,127,521,607,1279,2203,2281),
m(m) AS (SELECT POWER(CAST(2 AS BIGINT),n-1) FROM n)
SELECT m*(2*m-1) FROM m
|
May I ask you ?
Why your statement doesn't work ?
I have the message:
SQL0104N An unexpected token "N" was found following "". Expected tokens may include: "DSN_INLINE_OPT_HINT". SQLSTATE=42601
State:42601,Native:-104,Origin:[IBM][CLI Driver][DB2]
I am working with DB2 v8. Maybe you are using v9 ?
Thanks, Lenny
|
|