Paul Ngom wrote:Thanks Roel, The solution works perfectly.
But much more important: do you understand why this solution works and why you need 2 (inner) joins to get the desired result?
Paul Ngom wrote:Can you give the explanation, please?
Paul Ngom wrote:I have dealt with single inner join but i did not know i could have multiple ones with a select.
Paul Ngom wrote:select name as source_name,cost from country,costs where country.code=costs.source and cost=40;
Paul Ngom wrote:Probably i will have 'United states of America' printed under destination_name.
Paul Ngom wrote:I may not have understood you question well but if those are the only available 2 table then the query to produce the result you have given could be:
Paul Ngom wrote:No, I cannot. Any hint? :-)
Paul Ngom wrote:Then what do i do next if i am correct?
Paul Ngom wrote:select cs.name as source_name,cd.name as destination_name, c.cost from country_source cs,costs c,country_destination cd where cs.code=c.source and cd.code=c.destination and c.cost=40;
Am i right, Roel?
Paul Ngom wrote:I think the final answer is:
select cs.name as source_name,cd.name as destination_name, c.cost from country cs,costs c,country cd where cs.code=c.source and cd.code=c.destination and c.cost=40;
Paul Ngom wrote:Thanks a lot Roel for the time you spend with me in teachimg me that. I do appreciate it.
Paul Ngom wrote:It is getting to midnight at my side and i am readying to leave you now.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koophttps://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton