使用timesten连接数据库的一大堆乱七八糟的东西
使用timesten连接数据库的一大堆乱七八糟的东西
1
sql 单表无索引单列排序 SELECT * FROM MWT_UD_PD_SB_RH_DLQ ORDER BY XH 单表有索引单列排序 SELECT * FROM MWT_UD_PD_SB_RH_DLQ ORDER BY SCCJ 单表无索引多列排序 SELECT * FROM MWT_UD_SBD_SB ORDER BY XH, YXZT 单表分组 SELECT YXZT FROM MWT_UD_SBD_SB GROUP BY YXZT 分组排序 SELECT YXZT FROM MWT_UD_SBD_SB GROUP BY YXZT ORDER BY YXZT 单表分组求数量 SELECT YXZT,COUNT(*) FROM MWT_UD_SBD_SB GROUP BY YXZT 单表分组过滤 SELECT YXZT,COUNT(*) FROM MWT_UD_SBD_SB GROUP BY YXZT HAVING COUNT(*) < 10 单表分析函数 SELECT COUNT(*) FROM ( SELECT OBJ_ID,CLS_ID,CUSER_ID, DENSE_RANK() OVER(PARTITION BY OBJ_DISPIDX ORDER BY XH) RANK FROM MWT_UD_PD_SB_RH_JYZ ) WHERE RANK = 1 单表计算 SELECT AVG(OBJ_LOCALID),AVG(SL),SUM(OBJ_DISPIDX)/SUM(SL) FROM MWT_UD_PD_SB_RH_JYZ 单表分组计算 SELECT SL,AVG(OBJ_LOCALID),AVG(SL) FROM MWT_UD_PD_SB_RH_JYZ GROUP BY SL 单表计算过滤 select OBJ_DISPIDX ,LENGTH(OBJ_DISPIDX) from MWT_UD_SBD_SB where LENGTH(OBJ_DISPIDX) <=4 单表模糊匹配 select * from MWT_UD_SBD_DLFGQ where ZHDQMC like '67CF9F24-FA5E%' 多表联合查询 select * from MWT_UD_PD_SB_RH_JYZ j, MWT_UD_SBD_SB b where j.OBJ_ID = b.OBJ_ID 单表过滤查询 SELECT * FROM MWT_UD_PD_SB_RH_GTJC WHERE OBJ_DISPIDX BETWEEN 192089651 AND 198000000 2 tt导入导出 ttBulkCp -o -s "|""DSN=tt_1122;UID=cacheuser;PWD=timesten;oraclePWD=oracle"mw_app.MWT_UD_PD_SB_RH_JYZ /home/tt/test/mwt_ud_pd_sb_rh_jyz.txt
数据导入:
ttBulkCp -i"DSN=tt_1122;UID=cacheuser;PWD=timesten;oraclePWD=oracle"mw_app.MWT_UD_PD_SB_RH_JYZ /home/tt/test/mwt_ud_pd_sb_rh_jyz.txt
3
1、 Linux中连接timesten的命令 ttisql "DSN=tt_1122;UID=cacheuser;PWD=timesten;oraclePWD=oracle" 2、 Linux中启动和关闭timesten的命令 启动命令: ttDaemonAdmin –start –force 或 ttDaemonAdmin –startserver 关闭命令: ttDaemonAdmin –stop –force 或 ttDaemonAdmin –stopserver