Reputation: 1633
Does Derby have an equivalent syntax for in-line temporary tables such as these:
(this is valid DB2 syntax):
with data(a,b) as (values
('a',10),
('b',20),
('c',30),
('d',40)
)
select * from data
Thanks,
Pradyumna
Upvotes: 3
Views: 4351
Reputation: 12561
'DECLARE GLOBAL TEMPORARY TABLE (table-name)' etcera
I found this by googling on "Derby Temp Tables", it's the #1 result, and straight from the docs:
http://db.apache.org/derby/docs/10.2/ref/rrefdeclaretemptable.html
Upvotes: 3
Reputation: 16349
I'm not quite sure if this is what you're trying to achieve, but this works in Derby:
select a,b from (values ('a', 10), ('b', 20), ('c', 30)) as x(a,b);
Upvotes: 3