Wednesday, March 26, 2014

Excel vLookup vs SQL Join

This will sound rather obvious to Excel wizards. We had a problem with a very complex report that temporarily needed some extra details added. Rather than create a copy of the report we added some extra data to it via Excel. We extracted the extra data via SQL and then joined the two outputs via Excel using vLookup. An example of how to do this is here. The index match lookup method is recomended for very large spreadsheets.


An alternative would have been to pull the data back into the database using Cgywin via a temporary table. This would allow us to do a join via SQL in the usual fashion.

grep 'AP Invoices' ./ap_bal.csv > ap_edited.csv

Create Table Analysis (Transaction_Type Varchar2(130), Transaction_Number Varchar2(20)…………. );

sed 's+^+Insert Into Analysis (Transaction_Type, Transaction_Number) Values (+' ap2.csv > ap3.txt sed 's/$/,)/' ap3.txt > ap4.txt

Clean up and load with SQL Developer

1 comment:

jane holly said...

This professional hacker is absolutely reliable and I strongly recommend him for any type of hack you require. I know this because I have hired him severally for various hacks and he has never disappointed me nor any of my friends who have hired him too, he can help you with any of the following hacks:

-Phone hacks (remotely)
-Credit repair
-Bitcoin recovery (any cryptocurrency)
-Make money from home (USA only)
-Social media hacks
-Website hacks
-Erase criminal records (USA & Canada only)
-Grade change
-funds recovery

Email: onlineghosthacker247@ gmail .com