May 24, 2019 at 1:11 pm
table1
id value
2 20
3 30
4 40
5 50
6 60
7 null
the above table has to be inserted into another table2 with following fashion
i,e: it has to insert the value corresponding to 2 into col1 when id =2 ,col2 when id=3 and so on. note: insert empty when null is the value
table2
col1 col2 col3 col4 col5 col6
20 30 40 50 60 empty
May 24, 2019 at 7:59 pm
What would you insert if there are multiple source rows with the same Id? For example
id value
2 20
2 30
Would this require two inserts of 20 and 30, or a single insert of 50 (SUM), 25 (AVG), 20 (MIN) ... or some other aggregate?
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
May 25, 2019 at 12:29 am
There multipl wont be any scenario like multiple source rows with the same Id in my case
May 28, 2019 at 4:56 pm
This was removed by the editor as SPAM
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply