Need SQL command help...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • uno
    RIP Dodger. BEST.CAT.EVER
    • Dec 2002
    • 18450

    #1

    Need SQL command help...

    I need to change 30,000 variables all from 0 to 1 in a column in a table in sql...

    Can anyone give me the command line?
    -uno
    icq: 111-914
    CrazyBabe.com - porn art
    MojoHost - For all your hosting needs, present and future. Tell them I sent ya!
  • kernelpanic
    Too lazy to set a custom title
    • Jan 2005
    • 2961

    #2
    UPDATE `tablename` SET `columnname`='1';


    ZangoCash - Turn Your Traffic Into Ca$h.
    $.40 Per Install - No Tier

    Comment

    • swedguy
      Confirmed User
      • Jan 2002
      • 7981

      #3
      UPDATE tablename SET columnname=1 WHERE columnname=0

      incase you have other numbers than 0 and 1 in that column

      Comment

      • kernelpanic
        Too lazy to set a custom title
        • Jan 2005
        • 2961

        #4
        He said that all the variables were 0, though


        ZangoCash - Turn Your Traffic Into Ca$h.
        $.40 Per Install - No Tier

        Comment

        • Sly
          Let's do some business!
          • Sep 2004
          • 31376

          #5
          DELETE tablename
          Vacares - Web Hosting, Domains, O365, Security & More - Paxum and BTC Accepted

          Windows VPS now available
          Great for TSS, Nifty Stats, remote work, virtual assistants, etc.
          Click here for more details.

          Comment

          • uno
            RIP Dodger. BEST.CAT.EVER
            • Dec 2002
            • 18450

            #6
            hmm i don't want to change the column name, just the values in the column
            -uno
            icq: 111-914
            CrazyBabe.com - porn art
            MojoHost - For all your hosting needs, present and future. Tell them I sent ya!

            Comment

            • uno
              RIP Dodger. BEST.CAT.EVER
              • Dec 2002
              • 18450

              #7
              Maybe

              Update columnname where value = 0 set value =1?

              again i have non clue about the syntax
              -uno
              icq: 111-914
              CrazyBabe.com - porn art
              MojoHost - For all your hosting needs, present and future. Tell them I sent ya!

              Comment

              • Linguist
                Confirmed User
                • Apr 2004
                • 1706

                #8
                Here you go:

                update tablename set columnname=1 where columname=0
                315-310

                Comment

                • uno
                  RIP Dodger. BEST.CAT.EVER
                  • Dec 2002
                  • 18450

                  #9
                  I totally heart you.
                  -uno
                  icq: 111-914
                  CrazyBabe.com - porn art
                  MojoHost - For all your hosting needs, present and future. Tell them I sent ya!

                  Comment

                  Working...