468,543 Members | 1,795 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,543 developers. It's quick & easy.

VLookup equivalent MySQL multiple criteria

Hi everyone, first post so thanks in advance.

I have been trawling sites for 2 days trying to find the answer to this so apologies if I missed something (MySQL newbie!).

I have a table of reference data that presents a standard cost based on 3 criteria, example data shown below:


(note this is a sample, there are many more combos)

And I have a another table with a list of components that can have any combo of the first three columns as criteria i.e.



Here's the challenge. I need to identify the cost associated with each component and ideally store it as an additional column in the TABLE_COMPONENTS or create another temp table.

Hope that's clear. Thanks a lot.

Jun 6 '12 #1
1 3423
12,513 Expert Mod 8TB
You posted in the wrong forum. MS SQL Server is not MySQL. I have moved your thread.

User an Inner Join on the tables on the three fields. Don't store the price twice, there's no need to. You can just join the tables whenever you need to get the price.
Jun 6 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Emre DİNÇER | last post: by
1 post views Thread by Brendan Wolf | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.