Re: Re: pls Help us... (sql question)
От | Richard Huxton |
---|---|
Тема | Re: Re: pls Help us... (sql question) |
Дата | |
Msg-id | 005201c103dc$0b82e260$1001a8c0@archonet.com обсуждение исходный текст |
Ответ на | Re: pls Help us... (sql question) ("Ross J. Reedstrom" <reedstrm@rice.edu>) |
Ответы |
While Using COPY COMMAND ...
|
Список | pgsql-sql |
From: "Ross J. Reedstrom" <reedstrm@rice.edu> > Best to ask your questions on the list, so others may find them, > with (hopefully) helpful answers in the archives in the future. > > so, you've got a table with indistinguishable rows. I'm afraid you've > got to use an non ANSI extension. Every DB I've ever used has something > equivelant. In PostgreSQL, it's the 'oid', so in your case, you'd do: > > SELECT oid,Name from tablename; > > and see something like: > oid Name > ------- ------- > 102453 ibrahim first row > 102455 ibrahim second row > 103756 ibrahim third row > > > Then, you can delete, comparing on the oid: > > DELETE FROM tablename WHERE oid=102455; Ibrahim - if you want to prevent any more duplicate entries you can make the "name" column unique - see the CREATE TABLE docs but it would be something like: CREATE TABLE tablename ( "Name" varchar(64) UNIQUE; ); Then PG will fail any attempt to insert a duplicate value (it is the same as creating a UNIQUE index basically). - Richard Huxton
В списке pgsql-sql по дате отправления: