Mensaje
De
17/09/2006 10:11:30
 
General information
Foro:
Visual FoxPro
Category:
Bases de datos, tablas, vistas, índices y SQL
Título:
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
ID de la conversación:
01154440
ID del mensaje:
01154467
Views:
11
>Try
>
...
> LEFT JOIN InvoiceI ON Video.Numero=InvoiceI.NoVideo
> LEFT JOIN Invoice ON InvoiceI.NoInvoice=Invoice.Numero
>                         AND Invoice.AddUser=1
> WHERE Program.Active
> 	AND (InvoiceI.NoVideo IS NOT NULL
> 		OR Video.Numero = (
> 			SELECT MIN(Video.Numero) FROM Program p2
> 				JOIN Video v2 ON P2.Numero=V2.NoProgram
> 				WHERE p2.Numero = Program.Numero)
>             )
>
This works as it gets the first video of the program but it still also retrieves the video purchased which is the second one. I am trying to adjust the SQL to only get the first video of the program no matter what video was purchased.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Responder
Mapa
Ver