2010年9月7日 星期二

use subquery to insert data

mysql>insert into persons values('tommy','lin','22','male');
insert one record to table persons

mysql>insert into customers(lastname,firstname) select lastname,firstname where age=22 and sex='male' from persons limit 1;

use subquery to get data that insert into another table customers

沒有留言:

張貼留言