hi all, help me please.
CREATE TABLE `a_table` (
`id` int(11) NOT NULL,
`phone` varchar(20) NOT NULL,
`group` varchar(20) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO `a_table` VALUES (1, '111', 'cd');
INSERT INTO `a_table` VALUES (2, '222', 'cd');
INSERT INTO `a_table` VALUES (3, '333', 'cd');
INSERT INTO `a_table` VALUES (4, '444', 'xy');
INSERT INTO `a_table` VALUES (5, '555', 'xy');
INSERT INTO `a_table` VALUES (6, '666', 'xy');
CREATE TABLE `b_table` (
`id` VARCHAR( 11 ) NOT NULL ,
`phone` VARCHAR( 20 ) NOT NULL ,
`message` VARCHAR( 50 ) NOT NULL ,
PRIMARY KEY ( `id` )
) ENGINE = MYISAM ;
I want to SELECT phone FROM a_table WHERE group =xy. and insert a string = "I LOVE YOU" to b_table(phone,message).
condition row of b_table After Query/ Insert is:
----+----------------+----------------------+
id | phone | message |
----+----------------+----------------------+
1 | 444 | I LOVE YOU |
----+----------------+----------------------+
2 | 555 | I LOVE YOU |
----+----------------+----------------------+
3 | 666 | I LOVE YOU |
----+----------------+----------------------+
how to create query for this problem.
Thank you.