sql - Joining tables on multiple conditions -


I have a little problem - since IM is not very experienced in SQL - about being included in the same table at many prices . Imagine table 1 (strings) named:

  value of id 1 value1 2 value2  

and then table 2 (maps) ):

  Name of ID Description 1 1 2  

Hence the name is mentioned in the string table, as is the description of the string table referencing Without the second area, this will not be a problem, id just enter an internal entry at strings.ID = map.name. But now ID wants to get the actual string for description too. What will be the best way for a selection which gives me both? It looks like this now:

  select Maps.id, strings.value as mapName from the string INNER strings on strings.id = maps.name;  

But this is clearly included in only local names Thank you in advance.

You can do this in two tables together:

  SELECT M.id, sname.value as mapName, sdesc.value Sname.id = m.name INNER JOIN strings on Ons sdesc.id = m.description;  

Note the use of table aliens to differentiate between two tables.


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -