help
i have two tables one indicates the number of spots to selects depending on a time interval and a channel id.
table allocation
channelid dp1 dp2 dp3 dp4 dp5 dp6 dp7 dp8
8 4 2 2 2 1 1 1 1
9 2 0 2 2 1 1 1 1
19 5 3 3 3 2 2 2 2
table grid
gridid channelid bdate btime btype
.... 8 16200 720 soft
.... 8 16200 720 soft
.... 8 16200 1080 int
and so on
by the way dp1 : 0<= btime <21600
dp2 : 21600<= btime < 32400
dp3 : 32400<= btime < 43200
dp4 : 43200<= btime < 57600
dp5 : 57600<= btime < 68400
what i need to do is
1, select btype, gridids where btype is 'soft' and if btime falls into dp1, select dp1 many gridids,
if btime falls into dp2 select dp2 many gridids and they cannot follow each other.
for that i thought i could use
gridid % 5 = 0.
i couldnt put it all together
any idea on how to do this?
|