AntonioRodrigo
asked on
Update each row in the table based on results
Hello,
I have a DataTable of my customers orders with one empty column. My columns:
ID
ID_Name
ID_Name is the empty column. I am getting values for this column from another table, called products, which has ID's and names of each product:
ID_PROD
ID_Name_prod
ID_PROD is a foreign key for customers table (ID column).
How to update ID_Name column from customers table? I wanna get ID_Name_prod for each row in the customers table and update that row, which is initially empty.
And idea?
I am selecting ID_Name_prod with the query:
Select Producst.ID_Name_prod
FROM customers LEFT JOIN products
ON customers.ID = products.ID_Name_prod
This query returns column with all the products names - but how to update each row in my customers table?
Greetings, Frenky
I have a DataTable of my customers orders with one empty column. My columns:
ID
ID_Name
ID_Name is the empty column. I am getting values for this column from another table, called products, which has ID's and names of each product:
ID_PROD
ID_Name_prod
ID_PROD is a foreign key for customers table (ID column).
How to update ID_Name column from customers table? I wanna get ID_Name_prod for each row in the customers table and update that row, which is initially empty.
And idea?
I am selecting ID_Name_prod with the query:
Select Producst.ID_Name_prod
FROM customers LEFT JOIN products
ON customers.ID = products.ID_Name_prod
This query returns column with all the products names - but how to update each row in my customers table?
Greetings, Frenky
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi,
your question is bit unclear for me.
you saying you will getting products name from ID_Name_prod,
but you put same in
customers.ID = products.ID_Name_prod
there are many products for one customer.....
- Bhavesh
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window