sql---临时表

来源:互联网 发布:手机壁纸软件may 编辑:程序博客网 时间:2024/06/11 17:05

建立临时表并插入数据

select sector_id, phycellid as pci into temp    from tbcell    where sector_id in    (        select distinct tbcell.sector_id        from tbcell, tbcell38400        where tbcell.ENODEBID = substring(tbcell38400.SECTOR_ID, 1, 6)        union        select sector_id        from step1all_38400    )

更新临时表

update tempset temp.pci = Step1_result_38400.pcifrom temp, Step1_result_38400where temp.sector_id = Step1_result_38400.sector_id

删除临时表

drop table temp
0 0