c**t 发帖数: 2744 | 1 no delete. Here is the pseduo scripts:
package ETL
function load_feed1
return LOAD.IMPORT('A')
end;
function load_feed2
return LOAD.IMPORT('B')
end
end ETL
package LOAD
function IMPORT(externalTable as varchar2) return number
MERGE INTO targetTable x using externalTable y
on x.key = y.key
WHEN MATCHED THEN UPDATE
set field = y.field
WHEN NOT MATCHED THEN INSERT
(field1, field2) values (y.field1, y.field2);
|
|
B*****g 发帖数: 34098 | 2 is it same as Merge T with (A union all B)? |
|
c**t 发帖数: 2744 | 3 这么说吧, 10K merge 到 3M table, 大概7秒;30K要15秒左右.时间还是长了些
pending |
|
d*******8 发帖数: 3182 | 4 好像在merge statement中只支持update,insert,和delete。
看来只好用这个办法了。
谢谢噢! |
|
c**t 发帖数: 2744 | 5 like oracle or SQL Server 2008
MERGE INTO TblA USING TblB ON TblA.PK=TblB.PK
WHEN MATCHED THEN UPDATE ..
WHEN NOT MATCHED THEN INSERT ...
how to do it in SQL Server 2000?
Thinking to use cursor of TblB, then
UPDATE TblA set ... WHERE TblA.PK=Cursor.PK
if @@ERROR <> 0 then
INSERT INTO TblA ...
end
This worked, but seems too slow; any better way? |
|
c**t 发帖数: 2744 | 6 if in oracle why not just simply use merge? |
|
c*********n 发帖数: 128 | 7 I am wondering if there is a qry can the following job:
Let's say if we have two tables, TBL_1, TBL_2 with the same structure:
field_x, field_y.
Values in field_x are supposed to be unique.
I want to merge TBL_2 into TBL_1, that is,
1) for whatever value x existing in both TBL_2.field_x and
TBL_1.field_x, update the filed_y of records in TBL_1 to
TBL_2.field_y.
2) for whatever value x existing in TBL_2 but not in TBL_1, append
these records to TBL_1.
Currently I implement this purpose using 3 qu |
|
h******l 发帖数: 422 | 8 MERGE INTO TBL_1 AS Target
USING (SELECT field_x, field_y from TBL_2 ) AS Source (x2, y2)
ON Target.field_x = Source.x2
WHEN MATCHED THEN
UPDATE SET Target.field_y = Source.y2
WHEN NOT MATCHED BY TARGET THEN
INSERT (field_x, field_y) VALUES (x2, y2) |
|
c*********n 发帖数: 128 | 9 Sorry I forgot to mention I was working on Microsoft Access, so not every
SQL sentence works there.
MERGE seems to be one of those SQL phrases unavailable on Microsoft Access..
.... |
|
c*********n 发帖数: 128 | 10 Thanks for the reply!
So you mean there is no way to make a table containing the merged TBL_1 and
TBL_2?
I tried the following revised sentence (added "INTO TBL_MergeResult" in the
first line), but it didn't work and gave msg "An action query cannot be used
as a row source".
select b.field_x, b.field_y INTO TBL_MergeResult
from TBL_2 b left join TBL_1 a
on b.field_x = a.field_x
UNION ALL
select a.field_x, a.field_y
from TBL_1 a
where not exists (select 1 from TBL_2 b where a.field_x = b.field_x) |
|
c*********n 发帖数: 128 | 11 That works! Thanks so much!
My purpose is to merge (update existing and insert new) table2 into table1.
I did the job using the three queries in the first post but thought it's
kinda stupid to do it that way. |
|
h*****6 发帖数: 866 | 12 what is the difference between merge and update (oracle interview
question)? |
|
m*********e 发帖数: 533 | 13 update: updates existing data
merge: can do update and insert at the same time depending on the data
ex;
load product data to a product_incoming table first (staging table intest or
development system) and later the data from the product_incoming table will
be loaded to the product table (on the product system).
The matching key used can be product id column that is in both product table
and product_incoming table
If a particlar product id is in both tables, then the corresponding data row
will ... 阅读全帖 |
|
n****f 发帖数: 905 | 14 能否说说这个问题是想问什么概念吗?
还是有点不懂。merge 本身不就是 UPDATE. 一个没增加row, 另一个有可能增加。
考这个是什么目的? 多亏没去考试 --》 一准不及格。 |
|
e****7 发帖数: 4387 | 15 tsql 里merge 可以insert ,update , and delete, all in one transaction . |
|
g*******n 发帖数: 86 | 16 前一阵遇到了跟你一样的问题,我的方法是在sql server建立一个staging table,有
目标table一样的structure;bulk insert到这里,然后用sql query 给重复的row编上
号,然后只把这些id =1 的row insert到正式table里。这个query用sql里的merge |
|
g*******n 发帖数: 86 | 17 前一阵遇到了跟你一样的问题,我的方法是在sql server建立一个staging table,有
目标table一样的structure;bulk insert到这里,然后用sql query 给重复的row编上
号,然后只把这些id =1 的row insert到正式table里。这个query用sql里的merge |
|
c*****t 发帖数: 1879 | 18 【 以下文字转载自 Database 讨论区 】
【 原文由 coconut 所发表 】
I obtain table from peer 1 and table from peer 2.
Both peers may have identical rows and both may have different rows.
What is the sql command to merge the two table?
For ex
Peer1:
Name
abc
def
deg
Now add Peer 2 table:
Name
aaa
dddd
def
Can someone show me? Thanks |
|
|
N**D 发帖数: 10322 | 20 1 million lines is piece of cake
large file is usually in the order of TB today
large
files
merge |
|
b******r 发帖数: 79 | 21 好像记得cat 是用流的方式读文件, 读一行出一行, 这样的话应该就没有太多的内存的
问题吧。 不是很确定, 谁能clarify一下?
large
files
merge |
|
b*******g 发帖数: 513 | 22 怎样merge两个eps figures?linux下有什么现成好用的东东? 多谢! |
|
|
X****r 发帖数: 3557 | 24 Traversing a binary search tree is O(n) time and O(1) space, right?
Just to traverse two trees together, removing nodes from one tree
and insert them into the right place of the other, like merge sort. |
|
z***e 发帖数: 5393 | 25 瞟了一眼那个dsw算法,嗯,写paper真的要很能绕...
应该是差不多的做法,你把两个tree都用那个tree_to_vine变成一个基本上sorted的
list,然后就很好merge了,然后剩下就是又用那个vine_to_tree变回到balanced tree
(或者就不管了)。 |
|
g*****g 发帖数: 34805 | 26 Quicksort is an internal sorting algorithm, typically you have
to put the entire arrary in memory. Also, QS can be as slow as
O(N^2) in worst case. Merge sort normally is slower than QS
for a random array, but external sort is possible.
sort? |
|
X****r 发帖数: 3557 | 27 一般来说quick sort就好,只有在要保证最坏情况也是O(n*log(n))下才用heap sort。
merge虽然需要O(n)的额外空间,但是并不需要这个空间同时在内存里。换句话说
它的输入输出都是顺序读写的,而不是随机读写的。
sort? |
|
z****e 发帖数: 2024 | 28 list, forward backward access: merge sort
vector, random access: quick sort
right? |
|
d***q 发帖数: 1119 | 29 merge sort usually is useful when dealing with a large dataset which is
unable to be loaded into memory at once.. |
|
r*********r 发帖数: 3195 | 30 in STL, stable_sort() is merge sort. it's O(n*logn) when extra memory is
available, but O(n*(logn)^2) when not using extra memory.
STL's sort() is quick sort with some twists, it switches to heap sort when
the recursion depth is high, and uses insertion sort for small chunks.
sometimes this hybrid algorithm is called "introspective sort".
quick sort's performance heavily depends on how to pick the pivot. |
|
o*z 发帖数: 1078 | 31 如何sort and merge n 个sorted linked list?
假设n 很大,比如million, 用什么结构和方法优化? |
|
s*****y 发帖数: 11 | 32 如果我在几个不同的机器上spawn 几个 AKKA actor, 各自有各自的数据【格式一样】
,然后我想把这些数据merge到一个spark RDD里面统一进行处理, 怎么样的方式最好呢
? |
|
d********t 发帖数: 9628 | 33 看tutorial好像说rebase的话回重整history,不过我试了试根merge没任何不同啊。 |
|
c*********e 发帖数: 16335 | 34 rebase就是把它放到主线上,不再是branch.这个很少用。
一般是用merge. |
|
|
|
r***y 发帖数: 4379 | 37 要多于一个用户你才能看出rebase和merge区别 |
|
h******d 发帖数: 81 | 38 How to merge several PDF files into one? Thx! |
|
S**I 发帖数: 15689 | 39 Maybe you should just use inkscape to merge them. |
|
b*******g 发帖数: 513 | 40 怎样merge两个eps figures? 多谢! |
|
b*******g 发帖数: 513 | 41 问题解决了.一般用a2ps 在linux上,就可以。可能有的机器上不work,可以先用psmerge,把图片merge到一起。再用a2ps.:) |
|
d*********e 发帖数: 3835 | 42 BOGOTA (Dow Jones)--Colombia's largest airline Avianca SA and El Salvador's
Grupo Taca said Tuesday the merger they had announced in October became
effective after all regulatory hurdles were passed.
Synergy Aerospace Corp., which owns Avianca, Brazil's Ocean Air and an
option on Ecuador's AeroGal, will own 67% of the new merged airlines and
Taca's shareholders will own the remaining 33%, the companies said in a
statement.
Bolivian-born businessman German Efromovich controls Synergy and the Krie |
|
t**********y 发帖数: 374 | 43 我现在有一个物种的两个assembly contig/scaffold files:
一个是来自pacbio,
另一个是来自illumina
如果不想重现做assembly的话,只是想把两个merge一下,期望生成更长的conigs/
scaffolds, 什么tool比较好?
多谢了! |
|
B******1 发帖数: 9094 | 44 【 以下文字转载自 Crazymanfans 俱乐部 】
发信人: Beida101 (北大学子), 信区: Crazymanfans
标 题: WuXi AppTec won't merge with Charles River
发信站: BBS 未名空间站 (Fri Jul 30 12:14:22 2010, 美东)
Message from Dr. Ge Li, Chairman and CEO of WuXi AppTec
Dear Valued Customers,
As you may know, on July 29 we announced that our company and Charles River
Laboratories had agreed to terminate the combination agreement due to
opposition from certain Charles River shareholders motivated by short-term
financial interests, despite the tran |
|
k**********a 发帖数: 255 | 45 【 以下文字转载自 Business 讨论区 】
发信人: kimulatakuya (勤奋点啦), 信区: Business
标 题: 请问如何merge compustat和CRSP
发信站: BBS 未名空间站 (Sun Aug 7 22:34:31 2011, 美东)
本人没有安装SAS 所以很多SAS的程序不可以直接应用 具体的我用R 也有MySQL |
|
y*********d 发帖数: 1013 | 46 I tried merge function from Map algebra in the Spatial Analysis Toolbox, but
doesn't work. who kow how to deal with it? Thanks a lot.... |
|
G*****D 发帖数: 490 | 47 merge, mosaic or composite? you can find geoprocessing tools
but |
|
|
k**********a 发帖数: 255 | 49 【 以下文字转载自 Business 讨论区 】
发信人: kimulatakuya (勤奋点啦), 信区: Business
标 题: 请问如何merge compustat和CRSP
发信站: BBS 未名空间站 (Sun Aug 7 22:34:31 2011, 美东)
本人没有安装SAS 所以很多SAS的程序不可以直接应用 具体的我用R 也有MySQL |
|
g*******t 发帖数: 124 | 50 能不能把A里的变量都*1,这样吧char变成num,然后再merge
statement |
|