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,

Dipankar BiswasRank #992 · 2K reputationPosted Aug 24, 2014, 11:12 AM EDT
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';
Ramesh MaruthiRank #937 · 2.2K reputationPosted Aug 24, 2014, 3:03 PM EDT