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

  • Home
  • SEARCH
  • 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 7587201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:36:49+00:00 2026-05-30T19:36:49+00:00

I have a database named SCORPADData and it’s got two tables, Parts and Failure_Rates.

  • 0

I have a database named SCORPADData and it’s got two tables, Parts and Failure_Rates. I’m trying to take the column Reparable in the Parts table and set it as a boolean value based on the value in the condemnation rate table, which is somewhere between 0 and 100.0. A condemnation rate of 100.0 means the part cannot be repaired.

I’m doing this because I’ve been asked to take one database and make it readable to software that originally read from another in a one-time update. I’ve tried to do this in two different ways: using Case, and using Where with a set value of false. The statements are listed below.

UPDATE SCORPADData.Parts 
SET Reparable = CASE
    WHEN SCORPADData.Failure_Rates.Part_ID = SCORPADData.Parts.ID AND SCORPADData.Failure_Rates.Condemnation_Rate = 100.0 
        THEN 'TRUE' 
        ELSE 'FALSE' 
    END 
FROM SCORPADData.Parts , SCORPADData.Failure_Rates

The error I’m getting is “Column SCORPADDATA.FAILURE_RATES.CONDEMNATION_RATE not found”.

UPDATE SCORPADDATA.PARTS 
SET REPARABLE = TRUE

UPDATE SCORPADDATA.PARTS 
SET REPARABLE = FALSE 
FROM SCORPADDATA.FAILURE_RATES 
WHERE SCORPADDATA.PARTS.ID = SCORPADDATA.FAILURE_RATES.PART_ID 
    AND SCORPADDATA.FAILURE_RATES.CONDEMNATION_RATE = 100.0

The error I’m getting here is a syntax error; it doesn’t like my placement of FROM. Placing it after the WHERE also doesn’t work because it doesn’t find the column.

In both cases it’s my thinking that the FROM isn’t working as I was hoping because the FAILURE_RATES table isn’t used in the UPDATE SET statement. I’m working with an H2 database in a java application. I’m new to SQL, so my apologies if this is something I should know, but searching Google (or SO) for words like WHERE and FROM doesn’t get anyone anywhere.

  • 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-30T19:36:50+00:00Added an answer on May 30, 2026 at 7:36 pm

    I suggest to use a subquery, as this works in all databases. A complete example:

    drop table Parts;
    drop table Failure_Rates;
    create table Parts(ID int, REPARABLE boolean);
    create table Failure_Rates(PART_ID int, Condemnation_Rate double);
    
    insert into Parts values(1, null), (2, null), (3, null);
    insert into Failure_Rates values(1, 50), (2, 100);
    
    update Parts p set Reparable = (select
      (case when Condemnation_Rate = 100 then true else false end)
      from Failure_Rates f where f.PART_ID = p.id)
    where exists (select * from Failure_Rates f where f.PART_ID = p.id);
    
    select * from Parts;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a database table named 'student' in which there is one column named
I have two tables in my database named...Requests and Balance tracker which has no
I have two tables in my database named...Requests and Balance tracker which has no
Suppose I have a database named MyDatabase which has two tables - MyTable1 and
I have a database table named events with a column named date. Entries under
I have two models 'Company' and 'Vehicle' And two tables in database named same
I have a database named contacts.db with a table named TABLE_NAME that has one
I have a database named Tamaris, which contains a table User. I created a
I have a database table named Categories . I want to create a form
I have a simple database named customer with a single table data.I want to

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.