Re: no keys...
От | scott.marlowe |
---|---|
Тема | Re: no keys... |
Дата | |
Msg-id | Pine.LNX.4.44.0207161447480.30529-100000@css120.ihs.com обсуждение исходный текст |
Ответ на | Re: no keys... (Jeff Davis <list-pgsql-general@empires.org>) |
Список | pgsql-general |
On Tue, 16 Jul 2002, Jeff Davis wrote: > Each row automatically has an oid assigned to it, which can act as a key. It's > sort of "hidden", but all you have to do is "select oid,* from mytable" to > see it. Then you can delete based on that oid. > > Regards, > Jeff > > On Tuesday 16 April 2002 12:31 pm, Dorward Villaruz wrote: > > i have a table where there is no primary key > > > > i have 5 rows of data > > > > day1 time1 > > day1 time1 > > day1 time2 > > day1 time2 > > day1 time2 > > > > time2 is newer than time1, how should i delete the four oldest record in > > the table. this means that the only row that will be left on my table is: > > > > day1 time2 You can do something like this in sql: delete from test where oid !=(select max(oid) from test group by time order by time desc limit 1);
В списке pgsql-general по дате отправления: