Hi Lukas,
I have very difficult time using Result list of query as temporary table.
*Here are more details :*
*Actual sql script*
CREATE TABLE #hlm --- this is Temporary table hlm in SQL Server DB
(
id INT IDENTITY(1, 1) NOT NULL,
item_id INT,
ha_id INT,
period_id INT
)
insert into #hlm (item_id, ha_id, period_id)
SELECT item_id,
ha_id,
MAX(period_id) AS period_id
from *hierarchy_leaf *
group by ITEM_ID, ha_id
*For the above i have written JOOQ equalent script as below in two ways.*
HierarchyLeaf hl = HIERARCHY_LEAF.as("hl");
*Way 1 : *
Table<Record3<Integer, Short, Integer>> hlmTempTable =
ctx.select(hl.ITEM_ID,hl.HA_ID,(hl.PERIOD_ID).max())
.from(hl).groupBy(hl.ITEM_ID,hl.HA_ID).asTable();
*Way 2 : *
ctx.select(hl.ITEM_ID,hl.HA_ID,(hl.PERIOD_ID).max())
.from(hl).groupBy(hl.ITEM_ID,hl.HA_ID).asTable("hlmTempTable",
"ITEM_ID","HA_ID","PERIOD_ID");
*In both ways I tried but me not able to join the table hlmTempTable with
other table.*
*How to do it joining operation on derived table **hlmTempTable** ?*
*Also any specific example how to use asTable method of table ?*
Thank you.
~Shyam
--
You received this message because you are subscribed to the Google Groups "jOOQ
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.