Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 600A19FB47A; Tue, 17 Oct 2006 06:12:52 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 98602-05; Tue, 17 Oct 2006 06:12:44 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- X-Greylist: from auto-whitelisted by SQLgrey- Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.186]) by postgresql.org (Postfix) with ESMTP id AD7649FB318; Tue, 17 Oct 2006 06:12:43 -0300 (ADT) Received: from [194.25.154.138] (helo=webserv.wug.de) by mrelayeu.kundenserver.de (node=mrelayeu6) with ESMTP (Nemesis), id 0ML29c-1GZl053eHh-0008WS; Tue, 17 Oct 2006 11:12:42 +0200 Received: from kretschmer by webserv.wug.de with local (Exim 3.36 #1) id 1GZl02-0006bh-00; Tue, 17 Oct 2006 11:12:38 +0200 Date: Tue, 17 Oct 2006 11:12:38 +0200 From: "A. Kretschmer" To: pgsql-sql@postgresql.org, pgsql-novice@postgresql.org Subject: Re: [SQL] [GENERAL] How to split a table? Message-ID: <20061017091237.GA19268@a-kretschmer.de> References: <20061017083418.GA3917@KanotixBox> <71E37EF6B7DCC1499CEA0316A256832802B3E735@loki.wc.globexplorer.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <71E37EF6B7DCC1499CEA0316A256832802B3E735@loki.wc.globexplorer.net> X-OS: Debian/GNU Linux - weil ich es mir Wert bin! X-Message-Flag: "Windows" is not the answer. "Windows" is the question and the answer is "no"! User-Agent: Mutt/1.5.9i X-Provags-ID: kundenserver.de abuse@kundenserver.de login:51ea9561fc3f6d9539a2acd743e4748c X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.351 tagged_above=0 required=5 tests=AWL, SPF_HELO_PASS X-Spam-Level: X-Archive-Number: 200610/113 X-Sequence-Number: 17880 am Tue, dem 17.10.2006, um 1:53:35 -0700 mailte Gregory S. Williamson folgendes: > Perhaps something like: > > CREATE TABLE foo2 AS SELECT * FROM foo WHERE (rand() <= 0.60); Then we have 2 tables: one with 100% data and one with around 60% ;-) If the table contains a primary key you can delete simple the copied records from the origin table. (delete from origin where pk in (select pk from copy); > > -----Original Message----- Please, no top-posting with fullquote below. Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47215, D1: 0160/7141639 (mehr: -> Header) GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net