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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:53:27+00:00 2026-05-26T03:53:27+00:00

I am working with two tables, table one is part_order looks like ONum PNum

  • 0

I am working with two tables, table one is part_order looks like

ONum    PNum    NumOrdered  QuotPrice
2236    BZ66    1   
2236    AZ52    10          29.90
2237    CA14    3   
2240    CB03    1   

and table two is part and looks like

PNum    Description OnHand  Warehouse   UnitPrice
AZ52    Skates          20  2           36.95
BZ66    Washer          5   1           465.50
CA14    Skillet         13  1           28.99
CB03    Bike            44  3           195.50

I’m attempting to update my quotprice column with unitprice values, if it is null. Meaning the 29.90 should stay but the others should be updated.

I type in:

 update part_order
    set quotprice = (select part.unitprice
    from part
    where part.pnum = part_order.pnum
    and quotprice is null);

And it works aside from it switches the values. My 29.90 turns to null, and the other 3 values are updated. If I type it again, the other 3 values go back to null and the 2nd value is filled with 36.95. I am wondering why it changes the values instead of only checking for the null values.

  • 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-26T03:53:27+00:00Added an answer on May 26, 2026 at 3:53 am
     update part_order
       set quotprice = (select part.unitprice
                        from part
                        where part.pnum = part_order.pnum)
       WHERE quotprice IS NULL;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is the class I am working with: https://gist.github.com/2174233 I have two tables: one
OK, so I have two tables I'm working with - project and service ,
I am working on PHP and database MySQL. I have two tables in SQL
I'm working on a SQL Server 2008 database. This database has two tables. Book
I'm working with two independent c/c++ applications on Windows where one of them constantly
using mysql and php, I have two tables, I'm french so the table names
I have one table: dbo.Product Two columns: SKU Name --- ---- 100A-B (F102397) 1
I have two tables one named Person , which contains columns ID and Name
I have two table Part and SubPart. Part table has general fields like id,
I have array of two textboxes in a table, on blur of one text

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.