Advertisement
naimul64

Query to create new colum

Feb 16th, 2017
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.26 KB | None | 0 0
  1. --  creates column
  2. alter table disbursement_sheet_raw_data
  3. add composite_id varchar (15) default null;
  4.  
  5. -- adds unique value to column
  6. update disbursement_sheet_raw_data
  7. set composite_id = concat(SUBSTRING(ds_id_of_icr, - 8), cast(row_no_of_icr as char(2)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement