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 8781745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:23:03+00:00 2026-06-13T20:23:03+00:00

This is the select statement which i have got the correct answer: select s_billing_cycle.Billing_cycle

  • 0

This is the select statement which i have got the correct answer:

select s_billing_cycle.Billing_cycle from s_billing_cycle 
join o_daily_lcsgeneration_copy on o_daily_lcsgeneration_copy.Location=s_billing_cycle.Location where o_daily_lcsgeneration_copy.Date between s_billing_cycle.From_Date and s_billing_cycle.To_Date

while updating the same query into another table i couldnt do that using update query getting :
You cant update target table “o_daily_lcsgeneration_copy” for update in FROM Clause
the query i have used is :

update o_daily_lcsgeneration_copy  set o_daily_lcsgeneration_copy.Billing_cycle = (select s_billing_cycle.Billing_cycle from s_billing_cycle join o_daily_lcsgeneration_copy on o_daily_lcsgeneration_copy.Location=s_billing_cycle.Location where o_daily_lcsgeneration_copy.Date between s_billing_cycle.From_Date and s_billing_cycle.To_Date) 

Help me !!!

  • 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-13T20:23:04+00:00Added an answer on June 13, 2026 at 8:23 pm

    wrap it in a subquery (thus creating temporary table)

    UPDATE  o_daily_lcsgeneration_copy
    SET     o_daily_lcsgeneration_copy.Billing_cycle = 
    (
        SELECT Billing_cycle
        FROM
        (
            SELECT  s_billing_cycle.Billing_cycle
            FROM    s_billing_cycle
                    INNER JOIN o_daily_lcsgeneration_copy
                        ON o_daily_lcsgeneration_copy.Location = s_billing_cycle.Location
            WHERE   o_daily_lcsgeneration_copy.DATE BETWEEN s_billing_cycle.From_Date
                    AND s_billing_cycle.To_Date
        ) s
    )
    

    or JOIN the tables

    UPDATE  o_daily_lcsgeneration_copy a
            INNER JOIN s_billing_cycle b
                ON a.Location = b.Location
    SET     a.Billing_cycle = b.Billing_cycle
    WHERE   a.DATE BETWEEN b.From_Date AND b.To_Date
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I got this statement, which works fine: SELECT MAX(patient_history_date_bio) AS med_date, medication_name FROM
I have a SELECT statement like this: SELECT T1.COD, T1.NAME, (SELECT MAX(T2.DATA) FROM dbo.TAB2
I have a site with a SELECT statement like this: SELECT * FROM MyTable
We have this statement: (SELECT res_bev.bev_id, property_value.name AS priority FROM res_bev, bev_property, property_value WHERE
I have this SQL statement: SELECT * FROM history WHERE (fk_person = 2119) AND
I'm sitting with this SELECT statement I got ONE product separated into 5 products,
I have this ugly SELECT statement : Select 'Urbain' as Véhicule, Count( DISTINCT Plaintes.IDEvenements)
This SQL statement SELECT `ip`, `when` FROM `metrics` WHERE `vidID` = '1' GROUP BY
I have this mysql statement: SELECT `review_userid` , `book_id` , `review_id` , `user_class` ,
I have a SQL select statement which is comparing two tables. I am getting

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.