Re: last row of table after csv import
От | Daniel Staal |
---|---|
Тема | Re: last row of table after csv import |
Дата | |
Msg-id | d09e52055ea3769ef21c26cf5006499f.squirrel@www.magehandbook.com обсуждение исходный текст |
Ответ на | Re: last row of table after csv import (Henry Drexler <alonup8tb@gmail.com>) |
Список | pgsql-novice |
On Tue, October 18, 2011 7:34 am, Henry Drexler wrote: > perhaps first do a > select > count(*) from table > > then > > select > * > from > table > limit 1 offset (the result of your count(*) -1) This would get you a random row of the table. (Just a different random row than without the offset.) Easiest solution would be to add a new field to the table, that is an increasing counter, and take the highest value of that counter. But I have to ask: What is the actual problem you are trying to solve? There's probably a better solution than getting the 'last row'. Daniel T. Staal --------------------------------------------------------------- This email copyright the author. Unless otherwise noted, you are expressly allowed to retransmit, quote, or otherwise use the contents for non-commercial purposes. This copyright will expire 5 years after the author's death, or in 30 years, whichever is longer, unless such a period is in excess of local copyright law. ---------------------------------------------------------------
В списке pgsql-novice по дате отправления: