Link to home
Start Free TrialLog in
Avatar of PRAVEEN T
PRAVEEN TFlag for United States of America

asked on

Please help me on build sql for the requirement.

Hi,

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.
Avatar of PRAVEEN T
PRAVEEN T
Flag of United States of America image

ASKER

Please find the  attached.
test_ref.xlsx
Avatar of slightwv (䄆 Netminder)
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.
SOLUTION
Avatar of PortletPaul
PortletPaul
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.

Thanks.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial