Hi,
I have one table:
DId Description
1 desc1
2 desc2
I want insert Did in table2 based on description (means from front end I am inserting desc1 but in database table it should insert 1)
second table :
EId DId Name
1 1 name1
2 2 name2
I am using query with insert select statement but not working.
so please help in query to get this result.
Thanks,
Ramesh MaruthiPosted Aug 24, 2014, 7:03 PM
Dipankar BiswasPosted Aug 24, 2014, 3:12 PM
SQL INSERT INTO SELECT Examples
INSERT INTO Customers (CustomerName, Country)SELECT SupplierName, Country FROM Suppliers;
And
INSERT INTO Customers (CustomerName, Country)
SELECT SupplierName, Country FROM Suppliers
WHERE Country='Germany';