in reply to inserting a column into mySQL DB with perl
So did I get it right? You have both shown tables in you DB and you have a third table in a text file containing an idCars combined with an idSize, so something like this:
idCars idSize ------ ------ 1 3 1 2 2 1
And you want to get:
Car Size ---------- ---------- MiniCooper sedan MiniCooper compact Civic subcompact
I'd create a new table CarSize with the content of your text.
The query (your vlookup) would then be something like this:
select Car, Size from CarSize join Cars using(idCars) join Size using(idSize)
Note: Untested SQL Code I'd write for Oracle. The join-syntax might vary on mySQL.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: inserting a column into mySQL DB with perl
by diyaz (Beadle) on Jan 20, 2016 at 22:15 UTC |