把旧表中数据加入到新表中

1、把房源详情表 中某些数据加入到 房屋交易数据表中

INSERT INTO secondary.house
 (houNumber,houName,houSquareMeter,houTransactionPrice,
houListingPrice,houTransactionCycle,houNumPriceAdjustment,
cityName,regionOne,regionTwo,regionThree,
houNumConcerned,houNumViews,houTransactionTime)

SELECT 
    lj_number,house_title, deal_ave_price,deal_price,
    list_Price,deal_cycle,adj_price_num,
    city_name,region_1_name,region_2_name,region_3_name,
    care_peos,through_nums,deal_time

    FROM secondary.deal_re_2;

 2、把房源详情表 中某些数据加入到 房屋基本属性表中

INSERT INTO secondary.basicattributes
 (basNumber,basHouseType,basBuiltArea,basInsideArea,basHouseOrientation,
 basDecoration,basHeatingMode,basIsElevator,basFloor,
 basStructure,basBuildingType,basAgeArchitecture,
 basBuildingStructure,basLadderDoor)

SELECT 
    lj_number,house_type,area,within_area,house_towards,
    renovation,heat_type,is_elevator,floor_located,
    house_structure,building_type,finish_age,
    building_structure,ladder_proportions

    FROM secondary.deal_re_2;

3、把房源详情表 中某些数据加入到 房屋交易权属中

INSERT INTO secondary.transactionownership  (traNumber,traListingTime,traHousingYears,  traTransactionOwnership,traHousingUse,traHousingRight)  
SELECT     

lj_number,list_time,house_age,     right_to_trade,house_use,house_user      

FROM secondary.deal_re_2
原文地址:https://www.cnblogs.com/mrfanqie/p/mysql1914.html