Re: Deleting in order from a table

Поиск
Список
Период
Сортировка
От Ludwig Lim
Тема Re: Deleting in order from a table
Дата
Msg-id 20030105121837.20686.qmail@web80304.mail.yahoo.com
обсуждение исходный текст
Ответ на Deleting in order from a table  (pginfo <pginfo@t1.unisoftbg.com>)
Список pgsql-sql
--- pginfo <pginfo@t1.unisoftbg.com> wrote:
> I have a table tableA ( ....,order_num int).
> 
> I will to delete some records from tableA but in asc
> or desc
> order_num-order.
> 
> Is it possible to write delete from tableA where
> (some conditions) order
> by order_num ?
> 
> Many thanks,
> ivan.
> 

Try the following:
  DELETE  FROM tableA  WHERE order_num IN (       SELECT order_num       FROM tableA       ORDER BY order_num
LIMITn OFFSET m);  
 
Use LIMIT to determine the number of rows to delete
and OFFSET to determine the "starting row".

ludwig


__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com


В списке pgsql-sql по дате отправления:

Предыдущее
От: "Peter Galbavy"
Дата:
Сообщение: weighting (the results of) a query ?
Следующее
От: Cédric Dufour (public)
Дата:
Сообщение: Grant execute on functions; related objects permissions ?