![]() |
|
Archives of the TeradataForumMessage Posted: Tue, 19 Feb 2008 @ 15:07:16 GMT
Hi Michele: Here is the code to generate the desired rows using your table names:
with recursive temp (a2, b2,lvl) as
(sel product, max(cast(expanded_product as smallint)),0
from prod where product like '%X'
group by 1
union all
sel a2,b2+1,lvl+1 from temp where lvl < 9
)
sel a2,cast(b2 as char(4)) from temp where lvl > 0
Here is the problem that I did not realize previously: when using a derived table like this, select seems to be the only valid command. It would not let me do an insert/select. So, you would need to export these created rows using a select from your client and then import them using an insert using your client. Regards, Michael Larkins
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||