Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Re: Re: Re: SQL Update Error

by mpeppler (Vicar)
on Feb 18, 2004 at 21:55 UTC ( [id://330075]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: SQL Update Error
in thread SQL Update Error

As monktim says - in this particular case it serves no purpose. You'd use that form to limit the rows that are updated, or fetch data with which you wish to update the target table with a join, like this:
update the_table set col1 = t2.col2 from the_table t1 , other_table t2 where t2.id = t1.id and t1.somecol = "some value" and t2.anothercol = "some other value"
Having used Sybase for 15+ years I'm really used to this syntax, and I find it quite powerful (and you can do the same thing with DELETE of course).

Michael

Replies are listed 'Best First'.
Re:* SQL Update Error
by pelagic (Priest) on Feb 19, 2004 at 09:31 UTC
    ... looks reasonable to me.
    I use Oracle and DB2 and didn't know that feature but can imagine it's usefulnes.
    pelagic

    -------------------------------------
    I can resist anything but temptation.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://330075]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-19 10:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found