Title: Urgent Help : Use of return from function/procedure.
Hi,
I'm new to postgres and using version 7.2.4
I've created a trigger and function which does the following:
trigger 'T' fires after insert on a spcific table takes place and it executes function 'F'
Function 'F' retur
Hi,
Would this be OK or a little crude (untested) :
INSERT INTO new_table ( id, something )
SELECT
DISTINCT ON (id)
id,
something
FROM old_table
ORDER BY id
Or something similar but create a new table ?
Cheers
Rudi.
Denis Arh wrote:
How to delete "real" duplicates?
id | somthing
"Denis Arh" <[EMAIL PROTECTED]> writes:
> How to delete "real" duplicates?
Use the OID or CTID system columns.
regards, tom lane
---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if
> How to delete "real" duplicates?
>
> id | somthing
> ---
> 1 | aaa
> 1 | aaa
> 2 | bbb
> 2 | bbb
>
> (an accident with backup recovery...)
I'm not 100% on some of the syntax off the top of my head, but:
BEGIN;
ALTER TABLE orig_table RENAME TO backup_table;
CREATE TABLE ori
How to delete "real" duplicates?
id | somthing
---
1 | aaa
1 | aaa
2 | bbb
2 | bbb
(an accident with backup recovery...)
Regards,
Denis Arh
- Original Message -
From: "Franco Bruno Borghesi" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent:
Hi
I have another virtual problem, currently without any examples ;-)
Let's say we have some pl/pgsql function which puts result into table1.
This flat table must be normalized and put into table2. Sometimes 1 row from
table1 = 1 row from table2, but sometimes 1 row from table1= 3 rows from table2
try this
DELETE FROM aap WHERE id NOT IN (
SELECT max(id)
FROM aap
GROUP BY keyword
);
>
>
> Hi,
>
> I have a table with duplicates and trouble with my SQL.
> I'd like to keep a single record and remove older duplicates.
> For example below of the 6 recods I'd like to keep records
> 4 a
Am Sonntag, 22. Juni 2003 14:45 schrieb [EMAIL PROTECTED]:
> I have not used column check constraints before, but I'd like to start
> using then and so would I'll like to know if there is a direct way to
> provide feedback to the end user about data validation rules expressed in
> column check cons
Hi,
you need find duplicates and then you remove them
delete from aap where id not in ( select max(id) from aap b where
aap.keyword = b.keyword );
Germán
Sorry about my english
-Mensaje original-
De: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] En nombre de Rudi Starcevic
Enviado el: Do
I have not used column check constraints before, but I'd like to start
using then and so would I'll like to know if there is a direct way to
provide feedback to the end user about data validation rules expressed in
column check constraints?
For instance, say that I wanted to use a RE to check e-ma
On Fri, Jun 20, 2003 at 19:33:35 +0200,
javier garcia - CEBAS <[EMAIL PROTECTED]> wrote:
> Hi all;
>
> Peter, thank you very much for your help. Just a little thing. I've done as
> you say:
>
> CREATE TABLE rain_series_dated AS SELECT (year * interval '1 year' + month *
> interval '1 month' +
On 22/06/2003 10:15 Rudi Starcevic wrote:
Hi,
I have a table with duplicates and trouble with my SQL.
I'd like to keep a single record and remove older duplicates.
For example below of the 6 recods I'd like to keep records
4 and 6.
TABLE: aap
id | keyword
+-
1 | LEAGUE
On Sunday 22 June 2003 11:15, Rudi Starcevic wrote:
> Hi,
>
> I have a table with duplicates and trouble with my SQL.
(...)
> select a1.id
> from aap a1
> where id < ( SELECT max(id) FROM aap AS a2 )
> AND EXISTS
> (
> SELECT *
> FROM aap AS a2
> WHERE a1.keyword = a2.keyword
> )
How about (unte
Hi,
I have a table with duplicates and trouble with my SQL.
I'd like to keep a single record and remove older duplicates.
For example below of the 6 recods I'd like to keep records
4 and 6.
TABLE: aap
id | keyword
+-
1 | LEAGUE PANTHERS
2 | LEAGUE PANTHERS
3 | LEA
14 matches
Mail list logo