From: Jodi Kanter <jkanter@virginia.edu>
To: Postgres SQL List <pgsql-sql@postgresql.org>
Subject: query assistance
Date: Tue, 04 Nov 2003 10:16:30 -0500
Message-ID: <3FA7C2CE.4000902@virginia.edu> (raw)
Is there a straight forward way to pull out duplicates in a particular
field given a value in another field?
For example, I have a table that lists users and study names associated
with those users. Each user can have one or more study names. My goal is
to determine if any of these people have duplicate study names. There
are duplicated study names across the system and that is ok. I just want
to see if any users have duplicate study names among their studies.
My table looks like this:
Table "public.study"
Column | Type |
Modifiers
--------------+-----------------------------+------------------------------------------
sty_pk | integer | not null default
nextval('pk_seq'::text)
study_name | character varying(128) | not null
start_date | timestamp without time zone |
sty_comments | text |
created_by | integer |
Indexes: study_pkey primary key btree (sty_pk)
I am concerened with study_name. The created_by field tells me who owns it.
Thanks
Jodi
--
/_______________________________
//Jodi L Kanter
BioInformatics Database Administrator
University of Virginia
(434) 924-2846
jkanter@virginia.edu <mailto:jkanter@virginia.edu>/
/ /
/ /
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: jkanter@virginia.edu
Subject: Re: query assistance
In-Reply-To: <3FA7C2CE.4000902@virginia.edu>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox