Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need advice on SQL
Message
From
17/09/2006 10:11:30
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01154440
Message ID:
01154467
Views:
10
>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
Reply
Map
View

Click here to load this message in the networking platform