Avatar of PRAVEEN T
Flag for United States of America asked on

Please help me on build sql for the requirement.


How to update the table column which are matched with reference table columns.

I have four rows in main table. on 2 rows are matching and updated the specified columns. I need to update other two columns which are not matched with the reference table.
Oracle DatabaseSQL

Avatar of undefined
Last Comment
Pawan Kumar

8/22/2022 - Mon

Please find the  attached.
slightwv (䄆 Netminder)

I realize that Excel spreadsheet makes sense to you but it really doesn't help me.  From your previous question on this, I still don't see expected results.  In your other question I also saw where you wanted some column to have "not matched".  I don't see that here.

The solutions here will pretty much be the same in the other question:  I'll likely recommend MERGE again.

I also mentioned this in your other question:
We really need a very simple test case with a few columns, a few rows and the desired results.

There also appears to be problems with the Excel file you uploaded.  The MySQL for Excel is generating errors about a password vault when I try to open it.

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

Hi PortletPaul,

Thank you for provided the solution.
I have tested with the queries , its working as expected.
As your query is updating the description. I need transaction type also in the main table.
And one more requirement any row that is not matched with the reference table , need to update the transaction type and description as ' Not Matched'

Please help me to complete this.

Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.