C
cliff
I have following query to count n1 in last 2 sr's
Select a.sr, B.n1
FROM [sloto Union] AS a INNER JOIN [sloto union] AS B on (b.sr<a.sr) AND
(b.sr-a.sr<=2) AND (b.SR+2>=a.SR)
GROUP BY a.sr, B.n1
ORDER BY a.sr, b.n1
suppose I want to use where clause in above query to count n1 in say last 3
sr's or 4 sr's upto 50 sr's instead of writing changing the query every time
my data table is something like :-
sr n1
1 8
1 16
1 23
2 16
2 23
2 44
3 14
3 18
3 19
4 28
4 35
4 37
5 16
5 35
5 44
please help me
thanks
Select a.sr, B.n1
FROM [sloto Union] AS a INNER JOIN [sloto union] AS B on (b.sr<a.sr) AND
(b.sr-a.sr<=2) AND (b.SR+2>=a.SR)
GROUP BY a.sr, B.n1
ORDER BY a.sr, b.n1
suppose I want to use where clause in above query to count n1 in say last 3
sr's or 4 sr's upto 50 sr's instead of writing changing the query every time
my data table is something like :-
sr n1
1 8
1 16
1 23
2 16
2 23
2 44
3 14
3 18
3 19
4 28
4 35
4 37
5 16
5 35
5 44
please help me
thanks