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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:23:18+00:00 2026-05-20T03:23:18+00:00

I have to update my tables for my assignment in DBMS. Can’t figure out

  • 0

I have to update my tables for my assignment in DBMS. Can’t figure out why I get this error.

  UPDATE Customers
  SET CreditLimit = CreditLimit * 1.25
      FROM(SELECT *
           FROM Orders
           WHERE Amount > 250
           HAVING COUNT(*) >= 2);

Any ideas?

  • 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-05-20T03:23:18+00:00Added an answer on May 20, 2026 at 3:23 am

    The update statement doesn’t have a from clause, like you specified.
    Are you trying to do something like this:
    Increase credit limit by 25% for customers who have at least 2 orders for more than 250 money.

    update Customers
       set CreditLimit = CreditLimit * 1.25
     where (select count(*)
              from Orders
             where Amount > 250
               and orders.customer_id = Customers.customer_id)) >= 2;
    

    Edit
    I just noticed you are using Oracle (the ORA message). Since you are potentially updating all customers, I believe the most performant way would be to use an “updatable join”, or a merge statement like below:

    merge 
     into customers
    using (select customer_id
             from Orders o
            where amount > 250
            group 
               by customer_id
           having count(*) >= 2
          ) orders
        on(customers.customer_id = orders.customer_id)
    when matched then
       update
          set customers.creditlimit = customers.creditlimit * 1.25;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

can i use GROUP_CONCAT to update table? I have 2 tables i d |
I have this SQL update query: UPDATE table1 SET table1.field1 = 1 WHERE table1.id
I need to have MySQL query like this one: UPDATE table_name SET 1 =
I have some tables for which I have no reason to ever update from
I have two tables nol_art and #tmpIzm I want to update nol_art with value
I have a couple of tables (mySQL) that i would like to update with
I have a stored procedure that says update table1 set value1 = 1 where
Most schemas' tables have last_updated_date and last_updated_by columns. I knew how to populate this
I have a table that someone update this table every day. I would like
I have the following tables (this is abbreviated) tableAssignments id timestamp // updated when

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.