update colomn random using mysql

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tokcy
    New Member
    • Sep 2008
    • 45

    #1

    update colomn random using mysql

    hi everyone,

    i have a large database and i want to update one colomn(type is TIME) using RAND() function but i am not able to do so.
    please help me out. how can i use RAND() function.
  • wizardry
    New Member
    • Jan 2009
    • 201

    #2
    here is some articles on rand() and what it is used for



    W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.


    why would you want to update your table type time element using rand?

    rand is more or less a key generator, but you can create a timer with it.

    what are you using time for? date record created?

    need more info?

    Comment

    • tokcy
      New Member
      • Sep 2008
      • 45

      #3
      actually i have attendance database and due to some problem our server is not working and now i have install the software on my local machine and i want to insert time in those table. It is very difficult to insert value 1 by 1 thats why i am asking for Random function...

      Comment

      • wizardry
        New Member
        • Jan 2009
        • 201

        #4
        use a update statement and set the new element for that table. i.e.
        update tablename set column_name='ti me';

        just depends on how you wnt to store you time data in your table. you could use datetime and use now() which will automatically put the servers time / date in.

        or you could format it time='0:30'

        here is a reference for the formating options:

        http://dev.mysql.com/doc/refman/5.1/...functions.html

        Comment

        Working...