Access - consultas estadisticas numeros euromillon

 
Vista:
sin imagen de perfil
Val: 1
Ha disminuido su posición en 3 puestos en Access (en relación al último mes)
Gráfica de Access

consultas estadisticas numeros euromillon

Publicado por juan francisco (2 intervenciones) el 09/02/2020 19:44:06
Hola buenos días,

tengo una tabla llamada resultados, con las columnas fecha,n1,n2,n3,n4,n5,e1,e2, la fecha del sorteo, los numeros del 1 al 5 y las estrellas 1 y 2 numeros, necesito una cosulta que cuente las veces que lleva un número sin salir, es posible?. gracias. tengo esta que cuenta las veces que ha salido un numero
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
select numero, sum(contador) as veces from (
select fecha, n1 AS Numero, 1 AS Contador from resultados where n1 is not null
UNION
select fecha, n2 AS Numero, 1 AS Contador from resultados where n2 is not null
UNION
select fecha, n3 AS Numero, 1 AS Contador from resultados where n3 is not null
UNION
select fecha, n4 AS Numero, 1 AS Contador from resultados where n4 is not null
UNION
select fecha, n5 AS Numero, 1 AS Contador from resultados where n5 is not null)
where fecha in (select top 10 fecha from resultados order by fecha desc) group by numero,contador order by 2 desc,1 asc
UNION select numero,0 as contador from Numeros
where numero not in (select numero from (
select numero, sum(contador) as veces from (
select fecha, n1 AS Numero, 1 AS Contador from resultados where n1 is not null
UNION
select fecha, n2 AS Numero, 1 AS Contador from resultados where n2 is not null
UNION
select fecha, n3 AS Numero, 1 AS Contador from resultados where n3 is not null
UNION
select fecha, n4 AS Numero, 1 AS Contador from resultados where n4 is not null
UNION
select fecha, n5 AS Numero, 1 AS Contador from resultados where n5 is not null)
where fecha in (select top 10 fecha from resultados order by fecha desc) group by numero,contador order by 2 desc,1 asc))
ORDER BY 2 DESC , 1;
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder