Re: compare date in two rows
От | Oliveiros d'Azevedo Cristina |
---|---|
Тема | Re: compare date in two rows |
Дата | |
Msg-id | 26B13197D5C34FBE95B39540CE89993E@marktestcr.marktest.pt обсуждение исходный текст |
Ответ на | compare date in two rows (LALIT KUMAR <lalit.jss@gmail.com>) |
Список | pgsql-novice |
Does your table has a primary key, or does it have just those three columns?
----- Original Message -----From: LALIT KUMARSent: Friday, June 17, 2011 11:17 AMSubject: [NOVICE] compare date in two rowsHi,I have a table with following sample data.Village_name Date LabelA 1991-01-31 0A 1991-04-28 0A 1991-07-15 0B 2000-02-15 0B 2000-04-13 0B 2001-09-13 0C 1995-07-12 0C 1995-10-13 0I need to update the label to 1 when the number of days between two dates(when compared with previous date) is greater than 120 for each village.Illustration:For village A: row 1 date will not be compared to any date.row 2 date will be compared to row 1 date and if satisfies the condition label will be made 1.row 3 compare to row 2 and continue this till last row for village A.Similarly first date for village B,C.
В списке pgsql-novice по дате отправления: