All pastes #502113 Raw Edit

Something

public text v1 · immutable
·published 2007-05-22 11:00 UTC
rendered paste body
hi,
 i m having a table with columns like

date        quarter       quarter_id
1/12/2006      4
.
.
.
.
.
.
.
1/1/2007       1
.
.

now i want to update the quarter id on changing of each quarter

ie 
1/12/2006   qtr_id=1
1/1/2007          =2
.
.
.
1/4/2007          =3

how can we do it by sql?