Results 1 to 2 of 2
  1. #1
    Join Date
    May 2004
    Posts
    4

    Unanswered: multi-table update?

    i need to update the destination table, dt, with values from the source table, st, and join the two on the pk. i get a syntax error with the following :

    update dt set c1 = st.c1 from t1 as st, t2 as dt
    where dt.pk_id = st.pk_id and dt.last_modified <> st.last_modified

    that's sql server syntax that works, i just need help finding the equivalent mysql syntax.

  2. #2
    Join Date
    May 2004
    Posts
    4
    nevermind, i figured it out after finding a mysql reference manual.

    update t1 as st, t2 as dt set dt.c1 = st.c1
    where dt.pk_id = st.pk_id and dt.last_modified <> st.last_modified

Posting Permissions

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