473,654 Members | 3,109 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

sacar combinaciones

Hola grupo, paso a detallar mi problema:
En la base de datos tengo 4 campos: ID, Fecha, Posicion, Numero
Esta base de datos tiene todos los numeros sorteados en un juego de
azar, algo asi como una loteria.
Por dia se sortean 20 numeros, por cada cupon se puede jugar 1
combinacion de 7 numeros. Entonces yo lo quiero es:
Saber cuales son las combinaciones (de a 7 numeros) que mas veces
salen.
Tal vez para aclarar un poco mas el panorama, paso a copiar las
consultas SQL que estaban en access.

Las consultas estan hechas para obtener combinaciones de a 3 numeros,
por un tema de tiempo, ya que mas de 3 numeros access demora muchisimo
en realizar todas las consultas.

Nombre de la consulta: qryObtenNumero1
Consulta: SELECT Fecha, Numero AS Numero1 FROM tblDatosTombola ;

Nombre de la consulta: qryObtenNumero2
Consulta: SELECT Fecha, Numero AS Numero2 FROM tblDatosTombola ;

Nombre de la consulta: qryObtenNumero3
Consulta: SELECT Fecha, Numero AS Numero3 FROM tblDatosTombola ;

----------------

Nombre de la consulta: qryCombinacion4 Numeros
Consulta:
SELECT qryObtenNumero1 .Fecha, Numero1, Numero2, Numero3
FROM qryObtenNumero1 , qryObtenNumero2 , qryObtenNumero3
WHERE Numero2>Numero1 And Numero3>Numero2 And
qryObtenNumero1 .Fecha=qryObten Numero2.Fecha And
qryObtenNumero1 .Fecha=qryObten Numero3.Fecha;

----------------

Nombre de la consulta: qryCombinacione sRepetidas3Nums
Consulta:
SELECT Numero1, Numero2, Numero3, COUNT(*) AS NumRepeticiones
FROM qryCombinacion3 Numeros
WHERE Fecha<#8/11/2001#
GROUP BY Numero1, Numero2, Numero3
HAVING COUNT(*)>1;
Como pueden ver access utiliza los nombres de las consultas en las
propias consultas. Yo quiero saber como puedo usar estas consultas
trabajando en php y mysql.
Jul 23 '05 #1
0 2268

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4278
by: pakkocool | last post by:
¿Como ganar dinero en internet? Lee atentamente el siguiente texto, es super interesante y te hara ganar muchos dolares si sigues las instrucciones y le pones empeño: Hace unos días que estoy buscando la forma de ganar algún dinero más extra, a parte del que gano por navegar en Internet. Para ello recorro grupos de noticias, tablones, avisos clasificados, buscadores, etc. En todos estos lugares encuentro mensajes como el que...
5
2371
by: Ariel Gimenez | last post by:
Morning! After several hours breaking my mind, finally my code works, but i think is trash-code, can someone tellme how is the correct way to access the value of my cells within a datagrid?... in some cases i can access the values with e.Item.Cells.Text, but in other cases i have to do weird thinks like the following: TextBox pp; //I know...disgusting!!! pp= (TextBox) e.Item.Cells.Controls ; int id = Convert.ToInt32(pp.Text );
2
1526
by: Ariel Gimenez | last post by:
Hi, maybe some of you can give me a hand with this, I have a dll written in VB 6 but i havent the source code of it. In Visual Basic 6 this dll instanciates with createobject and the method was accesed in this way: mydll.method "1", "2", "3", True Now in Asp.net when i add the reference and try to call it this way: mydll.method("1","2","3",true);
2
9051
by: Ariel Gimenez | last post by:
Hi, im using a vb dll in my project and i need to access one object within it of type VBA.Collection, somebody can give me a hand to do this? i tried to cast to an array, object etc. but seems im in the wrong way... Thanks In Advance Ariel Gimenez
6
1223
by: Henke | last post by:
I have two versions of .NET Framework installet 1.0.3705 and 1.1.4322 Is it possible to set which one of the two my web application should use? Thanks! /Henke
1
309
by: Ariel Gimenez | last post by:
Hello, Can someone helpme? I have a datagrid in wich im using column templates for the edit command, with comboboxes. The datagrid works fine for the first time i execute the edit command but the second time it gives me the following error... Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request. For example, when adding...
3
2616
by: martinnapole | last post by:
Después de leer todo lo que sigue, me di cuenta que esto es un juego y yo decidí jugar. Sí, el que no arriesga no gana, asique YO JUEGO. Vos? Seguro que TIENE QUE HABER OTROS QUE PIENSAN IGUAL, que tambien se toman esto como un JUEGO, es por eso que acá ya tengo mis 6 sobres listos para mandar, por lo tanto les deseo suerte a los que los reciben y que lo disfruten. Una cosa, para que todos los que jugamos, SI O SI tenemos que cumplir
10
4721
by: LuisDavid | last post by:
Hola grupo que tal, tengo una inquietud no se si sea sencillo, o me estoy confundiendo; la cuestion es esta: tengo este array. var lista = new Array("uno","dos",tres","cuatro"); ahora como hago para que en una variable me tome un elemento del array lista; dependiendo de la longitud del elemento; en este caso que me extraiga el elemento: lista por ser: lista.length = 6 //el numero de mayor longitud respecto a los otros elementos del array...
0
8372
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8285
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8814
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8706
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8475
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7304
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5621
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4149
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1915
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.