Wednesday, 25 April 2018

Update Column With Random predefined word list in PostgreSQL


   Update Column With Random  enum word list in PostgreSQL ?
   How to Update Column With Random word ?

    UPDATE stock
    SET shape = (
              (
               ARRAY['CS','CM','RN','EM','AS','PR','OV','HT','BG','Round','MQ','PC']
              )          [floor(random()*12)+1]
           );

No comments:

Post a Comment