Article 5EV4N [SQL] JOIN by mapping table

[SQL] JOIN by mapping table

by
czezz
from LinuxQuestions.org on (#5EV4N)
Code:TABLE: first_name
id
name

TABLE: last_name
id
name

TABLE: mapping
firstname_id
lastname_idHow can I map/match first_name.namewith last_name.name by mapping table?
I was trying to use INNER JOIN but that fails:

Code:SELECT first_name.name, last_name.name
FROM mapping
INNER JOIN first_name ON first_name.id = mapping.firstname_id
INNER JOIN last_name ON last_name.id = mapping.lastname_id;
ERROR: table name "mapping" specified more than oncelatest?d=yIl2AUoC8zA latest?i=_rVsSQu5shc:keZ_ujytB5o:F7zBnMy latest?i=_rVsSQu5shc:keZ_ujytB5o:V_sGLiP latest?d=qj6IDK7rITs latest?i=_rVsSQu5shc:keZ_ujytB5o:gIN9vFw_rVsSQu5shc
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments