神剑山庄资源网 Design By www.hcban.com
创建前可先删除
drop table tmp0
创建临时表
select * into temp table tmp0 from xxx create index idx_tmp0_inner_cd on tmp0(inner_cd);
查看临时表是否创建,返回0表示未创建,1为创建
select count(*) from pg_class where relname = 'tmp0'
或者用下面,下面语句在pg和mysql中都适用
Create Table If Not Exists temp.MyTable( xxx varchar (20) Primary key , thTime varchar (20) , name varchar (20) )
同样可以用在删除表中:
DROP TABLE If Exists temp.mjp_temp_update_log
应用例子:
SELECT ids, code, INTO TEMP TABLE tmp0 FROM TEMP .m_product_x WHERE TEMP .m_product_x.ids = '' GROUP BY TEMP .m_product_x.code, TEMP .m_product_x.ids; CREATE INDEX idx_tmp0_inner_cd ON tmp0 (code); SELECT * FROM TEMP .m_product INNER JOIN tmp0 ON TEMP .m_product.code = tmp0.code WHERE TEMP .m_product.ids = '' ORDER BY tmp0.xx, tmp0.ss; DROP TABLE tmp0;
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。
标签:
PgSQl,临时表
神剑山庄资源网 Design By www.hcban.com
神剑山庄资源网
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
神剑山庄资源网 Design By www.hcban.com
暂无PgSQl临时表创建及应用实例解析的评论...
更新日志
2024年10月18日
2024年10月18日
- 群星《歌手2024 第4期》[FLAC/分轨][563.76MB]
- RiffKitten-ChaosParade(2024)[24-44,1]FLAC
- RuneKlakegg-Nattevandrer(2024)[24-96]\FLAC
- 赖冰霞.2006-金嗓典藏辑2IN1(南方金点系列)2CD【南方】【WAV+CUE】
- 群星.1988-国语金曲尽精英VOL.2【瑞成】【WAV+CUE】
- 张宇.1999-雨一直下【EMI百代】【WAV+CUE】
- 袁娅维.2021-月亮失眠了(DELUXE)【华纳】【FLAC分轨】
- AlanBroadbent-JazzFunk(2024)[24-44,1]
- 梅艳芳《绝代芳华》开盘母带[低速原抓WAV+CUE]
- ABC唱片-《外国精逊母带直刻神奇黑胶[APE+CUE].
- 群星《天赐的声音第五季 第6期》[320K/MP3][101.43MB]
- 群星《天赐的声音第五季 第6期》[FLAC/分轨][526.16MB]
- 群星《说唱梦工厂 第2期》[320K/MP3][96.37MB]
- 杨宗宪.1994-留你留袂着【有容唱片】【WAV+CUE】
- 李翊君.2005-勇敢的爱【创意唱片】【WAV+CUE】