Archives of the TeradataForum
Message Posted: Tue, 20 Nov 2012 @ 13:25:03 GMT
If I go by the below given query, suppose we have million records in source table. In every each of records insert the subquery is getting MAX(subline_id) value from target table and having addition with ROW_NUMBER() value. And I guess it will happen million times. Is not a performance issue ?
SELECT ROW_NUMBER () OVER (ORDER BY subline_id) + ( SELECT COALESCE(MAX(subline_id), 0) FROM ttmp.test_dipti_csum ) FROM ttmp.test_dipti_csum AS STAGE;
|Copyright 2016 - All Rights Reserved|
|Last Modified: 28 Jun 2020|