SSK
SSK

Reputation: 285

Appending Data at top in column

I am trying append the data the start of the particular row . I've written query for appending at the end of particular row.

update yourtable 
set yourcol = case when yourcol is null then 'a,b,c'
                  else concat(yourcol, ' a,b,c') end

How i can write for appending values at start of the particular instead of inserting bottom of the table.

Upvotes: 0

Views: 28

Answers (1)

Ravinder Reddy
Ravinder Reddy

Reputation: 24002

I think you want to prepend new data on column data.

update yourtable 
   set yourcol = case when yourcol is null then 'a,b,c'
                      else concat( 'a,b,c', ',', yourcol ) -- add a comma as well
                 end

Upvotes: 1

Related Questions