SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Addict
    Join Date
    Mar 2005
    Posts
    319
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    UPDATE query with JOIN

    Code MySQL:
    UPDATE ct 
    		SET ct.site_id = su.site_id 
    		FROM credit_transactions AS ct 
    		JOIN site_user AS su ON ct.user_id = su.user_id

    I get

    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM credit_transactions AS ct JOIN site_user AS su ON ct.user_id = su.user_' at line 3
    Ive looked all over google and it seems my syntax is correct :/

  2. #2
    SitePoint Addict
    Join Date
    Mar 2005
    Posts
    319
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nevermind, it was

    UPDATE credit_transactions as ct JOIN site_user AS su ON ct.user_id = su.user_id
    SET ct.site_id = su.site_id


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
  •