Update Without Set

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • xpcer
    New Member
    • Jul 2006
    • 51

    Update Without Set

    my friend ever tell me that he have seen an update query without using SET , can anyone tell me how to use it in mysql
    thanks
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    That's not what the MySQL documentation says

    Comment

    • sashi
      Recognized Expert Top Contributor
      • Jun 2006
      • 1749

      #3
      Hi there,

      are you sure you friend were talking abt an UPDATE query? was is not SELECT INSERT DELETE queries respectively? well.. i feel that UPDATE is not complete without the SET keyword along with it.. isn't Banfa? :)

      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.

      Comment

      • ronverdonk
        Recognized Expert Specialist
        • Jul 2006
        • 4259

        #4
        SET is absolutely mandatory in the UPDATE statement!

        Ronald :cool:

        Comment

        • tejaswini
          New Member
          • Jul 2006
          • 7

          #5
          You cannot have update without SET its compulsory

          Comment

          • craft
            New Member
            • May 2007
            • 1

            #6
            hey there,

            I guess ur friend should be kidding, or he's a wack programmer...Up date does the update in the database, while the set statement does the change of values,,,there must be a change of value before an update can occur...that's the rule...

            Code2Craft

            Comment

            • nikdeapen
              New Member
              • Aug 2012
              • 1

              #7
              An update can be useful without the set clause but it is syntactically required.

              A statement like:
              UPDATE records SET records.id = records.id WHERE records.id = x;

              will not update any information but will fire the update trigger for the given row.

              I have used this in a couple places to log a reset of a record with no information changes.

              Comment

              Working...