I need to find a way to make INSERT INTO table A , but one of the values ββis what comes from the search in table B, let me illustrate.
I have the following two tables:
Table a:
A1: String A2: Integer value coming from table B A3: More Data
Table B:
B1: String B2: Integer Value
Example line A: {"Value", 101, MoreData} Example line B: {"English", 101}
Now I know that I need to INSERT the following in {"Value2", "English", MoreData}, but obviously this will not work, because the integer in the second column is not expected to mean the word "English", so I you must first search in table B.
Something like that:
INSERT INTO tableA (A1, A2, A3) VALUES ("Value2", SELECT B2 FROM tableB where B1="English", MoreData);
Obviously, this does not work as it is ...
Any suggestions?
sql insert-into
Shaitan00
source share