2020-05-28

mysql 给查询结果新增一个字段,并设定默认值

mysql 给查询结果新增一个字段,并设定默认值


SELECT '第一中学' as school, class, name, geography FROM test_table WHERE test = 1;

 

 插入新table:

REPLACE INTO test_school(school, class, name, geography) SELECT '第一中学' as school, class, name, geography FROM test_table WHERE test = 1;

 


No comments:

Post a Comment