Michel,
This query will work because it is not doing any join to the invoice tables, it is only joining the program master to the videos in the program and getting the first video that is part of the program. Unless I misunderstand what the Program and Video tables are storing.
>>
>>SELECT Program.Numero,MIN(Video.Numero) AS FirstVideo ;
>> FROM Program;
>> INNER JOIN Video ON Program.Numero=Video.NoProgram;
>> WHERE Program.Numero = TheProgramYouWant ;
>> GROUP BY Program.Numero
>>
>
>This would not work because not all videos of a program could be part of the result. Thus, if the user only purchased the 2nd and 3rd video of the program, I will not be able to extract the first one of the program by the use of MIN() as it will not be part of the INNER JOIN.
>
>Sergey and Fabio suggested two approaches that should work. I will check on those next messages next.