一.使用Logstash将mysql数据导入elasticsearch 1.在mysql中准备数据: mysql> show tables; +----------------+ | Tables_in_yang | +----------------+ | im | +----------------+ 1 row in set (0.00 sec) mysql> select * from im; +----+------+ | id | name | +----+------+ | 2…
1.假如A表存在 insert into A(a,b,c) (select a,b,c from B) 2.假如A表不存在 select a,b,c into A from B 3.假如需要跨数据库 insert into ADB.[dbo].A(a,b,c) (select a,b,c from BDB.[dbo].B)…
ALTER PROCEDURE [dbo].[usp_ea_Copy] ( @eaId int, @createdBy varchar(), @newEaId int output ) AS declare @count as int declare @newId as int select @count=count(*) from Ea where id=@eaId; begin RAISERROR (, ) end --unit_titlecode,ReceivedTime,Received…
UPDATE user_online_month_atu a INNER JOIN ( SELECT user_id, sum(c.online_times) as online_times, SUM(c.login_count) as login_count, Sum(c.view_page_count) as view_page_count, LEFT(c.log_date,length(c.log_date) - 2) as date FROM user_online_time_atu c…
* 说明:复制表(只复制结构,源表名:a 新表名:b) select * into b from a where 1<>1 * 说明:拷贝表(拷贝数据,源表名:a 目标表名:b) insert into b(a, b, c) select d,e,f from b; * 说明:显示文章.提交人和最后回复时间 select a.title,a.username,b.adddate from table a,(select max(adddate) adddate…