Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8556057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:15:37+00:00 2026-06-11T15:15:37+00:00

I’ve seen a couple of questions about this particular error message, but couldn’t find

  • 0

I’ve seen a couple of questions about this particular error message, but couldn’t find any that matches my problem.

Just a quick explanation of my problem.

I have a table containing the results for some games.

When someone is absent, we store the average of this person for the previous games as the game result and we set the property f_present to 0.

For that part no problem.

The problem occurs when we modify an old game, I have to update all following games where someone is absent to store a new value (the new average of that player for the game he is absent.)

I’m able to do the query, but I’m unable to do the update because of the “You can’t specify target table for update in FROM table” error message.

Here’s is my query (which works)

   select t1.f_subgame_id,
    t1.F_PLAYER_ID, 
    (SELECT avg(t2.f_result) 
     from t_subgames_results t2 
     join t_subgames t2s on t2s.f_subgame_id = t2.f_subgame_id
     join t_seasons_games t2ss on t2ss.f_game_id = t2s.f_game_id
     where F_RESULT > -1 
       and F_PLAYER_ID = t1.F_PLAYER_ID
       and t2ss.F_SEASON_ID = t1ss.F_SEASON_ID
       and t2ss.F_DATE < t1ss.F_DATE
     )
    from t_subgames_results t1
    join t_subgames t1s on t1s.f_subgame_id = t1.f_subgame_id
    join t_seasons_games t1ss on t1ss.f_game_id = t1s.f_game_id
    where t1ss.f_date>'2012-09-07' and t1.F_PRESENT = 0;

Here’s my attempt to update:

   update t_subgames_results t1
   join t_subgames t1s on t1s.f_subgame_id = t1.f_subgame_id
   join t_seasons_games t1ss on t1ss.f_game_id = t1s.f_game_id
   set f_result = 
    (SELECT avg(t2.f_result) as result
     from t_subgames_results t2 
     join t_subgames t2s on t2s.f_subgame_id = t2.f_subgame_id
     join t_seasons_games t2ss on t2ss.f_game_id = t2s.f_game_id
     where F_RESULT > -1 
       and F_PLAYER_ID = t1.F_PLAYER_ID
       and t2ss.F_SEASON_ID = t1ss.F_SEASON_ID
       and t2ss.F_DATE < t1ss.F_DATE
     )
   where t1ss.f_date>'2012-09-07' and t1.F_PRESENT = 0;

Again, I know there are a couple of topics about this problem but can’t seem to find that relate to my problem …

Thanks again for helping me out !

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T15:15:38+00:00Added an answer on June 11, 2026 at 3:15 pm

    I ended up with this, thanks a lot !

    create temporary table t_results_temp SELECT * from t_subgames_results;
    
    update t_subgames_results t1
    join t_subgames t1s on t1s.f_subgame_id = t1.f_subgame_id
    join t_seasons_games t1ss on t1ss.f_game_id = t1s.f_game_id
    set f_result = 
    (SELECT COALESCE(avg(t2.f_result),0) as result
     from t_results_temp t2 
     join t_subgames t2s on t2s.f_subgame_id = t2.f_subgame_id
     join t_seasons_games t2ss on t2ss.f_game_id = t2s.f_game_id
     where t2.F_RESULT > -1 
       and F_PLAYER_ID = t1.F_PLAYER_ID
       and t2ss.F_SEASON_ID = t1ss.F_SEASON_ID
       and t2ss.F_DATE < t1ss.F_DATE
     )
    where t1ss.f_date>'2012-09-07' and t1.F_PRESENT = 0;
    
    drop table t_results_temp;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I know there's a lot of other questions out there that deal with this
I have a French site that I want to parse, but am running into
This could be a duplicate question, but I have no idea what search terms
Seemingly simple, but I cannot find anything relevant on the web. What is the
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.