SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Oct 2007
    Posts
    118
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Updating a field, how.. Plz help.

    Hi,

    I have two tables "s" and "a", from which i need to append "Dolby" at the start of the "type" field in "a" table for all fields in table "s" having "Dolby" in location field of "s" table. How do i update the "a" table?

    I have written the update statement, but its not working...

    update a set type = concat('Dolby',type) where type="AC3" and location like '%Dolby%'' right join s on (s.sid=a.sid);


    Thanks,
    Ramki

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,220
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    you can't do a join after the WHERE clause
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •