I'm trying to update my table from another table
I need to update the IP in table1 from the new_IP in table changeip according to the SIM number (whcih is the same on both tables)
I have try to do it from what it say here : mysql update column with value from another table
I get error "IP can't be null"
this is what I wrote in the command line
UPDATE table1
SET table1.IP = (
SELECT changeip.New_IP
FROM changeip
WHERE table1.SIM_NEW = changeip.SIM_Number
);
what am I doing wrong ?
****************update
this is table1
'10.226.202.169', '8997250000031944123'
'10.226.202.170', '8997250000031944131'
'10.226.202.173', '8997250000031944164'
'10.136.136.101', '8997250400019201597'
'10.136.136.102', '8997250400019201589'
'10.136.136.103', '8997250400019201571'
'10.136.136.104', '8997250400019201563'
and so on........
this is changeip table
'10.226.202.169', '8997250000031944123', '10.136.137.221'
'10.226.202.170', '8997250000031944131', '10.136.137.222'
'10.226.202.173', '8997250000031944164', '10.136.137.223'
'10.226.202.174', '8997250000031944172', '10.136.137.224'
'10.226.202.175', '8997250000031944180', '10.136.137.225'
'10.226.202.177', '8997250000031944206', '10.136.137.226'
Thanks ,