I have SQL table1 with value 'value1' in column Type. Then I have second table table2 in column Name 'value1'.
In table2 in row with name 'value1' (unique data in this table), there are more column: color -> 'red', icon -> 'checkmark', type -> 'something'. How to join queries to put values from joined table to main table? I've searched for it, but I didn't find this type of joining.
I want select from table table1 + data from table2
Thanks!
Here is an example for your usecase. First build up your structure (like in task description):
Then insert some sample data:
And now your join statement for inserting the data (in my example just the type of table2):
You can change the Where clause for your usecase to insert different types of table2 into table1.
If just want to show the additionally data from table2 then you have to make a union all:
If you just want to show a large row of whole data from table1 and table2 then just use (then you get all columns):
I hope it helps.