English 中文(简体)
4. 铁路局与Ruby
原标题:Bulk upsert with Ruby on Rails
问题回答

如果你在《邮政总协定》9.1中,你就应使用书面共同表格表示。 类似:

WITH updates (id) AS (
     UPDATE mytable SET .....
      WHERE ....
     RETURNING id
)
INSERT INTO mytable (....)
SELECT ... 
  FROM mytemptable
 WHERE id NOT IN (select id from updates);

在这种情况下,你在一张头张的桌子上处理大量问题,然后将努力根据你的逻辑从记本中更新记录,并插入其余部分。

它有两个步骤。 首先,你们需要打上XML文件。 如果用户通过表格提供,否则你需要使用吉大港山区标准平衡或机械化(实际上是巨大的)等一些灰em。

第二件事情确实容易。 你们把所有XML都看成一个扼子,然后,你可以把它变成一个 has子,用这个密码:

Hash.from_xml(xml_string)

然后,你可以整理数据......





相关问题
摘录数据

我如何将Excel板的数据输入我的Django应用? I m将PosgreSQL数据库作为数据库。

Postgres dump of only parts of tables for a dev snapshot

On production our database is a few hundred gigabytes in size. For development and testing, we need to create snapshots of this database that are functionally equivalent, but which are only 10 or 20 ...

How to join attributes in sql select statement?

I want to join few attributes in select statement as one for example select id, (name + + surname + + age) as info from users this doesn t work, how to do it? I m using postgreSQL.

What text encoding to use?

I need to setup my PostgreSQL DB s text encoding to handle non-American English characters that you d find showing up in languages such as German, Spanish, and French. What character encoding should ...

SQL LIKE condition to check for integer?

I am using a set of SQL LIKE conditions to go through the alphabet and list all items beginning with the appropriate letter, e.g. to get all books where the title starts with the letter "A": SELECT * ...

热门标签