MySQL foreach loop
问题 I have to iterate each row in my table User in MySQL. I need to create a new row Address for each iteration in User with some conditions described below. I have 3 tables: User: id, stuff, id_person, email Person: id, stuff, id_address Address: id, email I need to create a new row in Address if the User.id_person is NOT NULL and that person.id_address IS NULL. I have to create the row with the same email that User.email. I have to do that for each row in User. I tried to use MySQL cursor's but