Skip site navigation (1) Skip section navigation (2)

Re: compare two rows

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Richard Broersma" <richard(dot)broersma(at)gmail(dot)com>, "Ben Kim" <bkim(at)tamu(dot)edu>
Cc: <pgsql-admin(at)postgresql(dot)org>
Subject: Re: compare two rows
Date: 2010-10-12 22:30:28
Message-ID: 4CB49B3402000025000368C0@gw.wicourts.gov (view raw or flat)
Thread:
Lists: pgsql-admin
Ben Kim <bkim(at)tamu(dot)edu> wrote:
 
> create table test_dup (id serial primary key, val text);
 
> How can I check whether the two rows are the same or different?
 
Well, with a primary key in there, they had *better* be different.
 
It would seem you want to see if some *subset* of the columns in two
rows match?  All columns except those in the primary key?
 
The next question is whether you want to just compare two specific
rows or list all duplicates.
 
-Kevin

In response to

Responses

pgsql-admin by date

Next:From: Ben KimDate: 2010-10-13 03:16:43
Subject: Re: compare two rows
Previous:From: Richard BroersmaDate: 2010-10-12 22:17:23
Subject: Re: compare two rows

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group