Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need advice on SQL
Message
From
16/09/2006 21:30:01
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Need advice on SQL
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01154440
Message ID:
01154440
Views:
57
From the following SQL, I obtain some video information in regards to the video purchased by a user, when the video is part of a program. A program contains multiple videos.
SELECT Program.Numero,Program.Active,Program.Title,Program.Notes_E,Program.Notes_F,Program.NoMaster,;
 Master.FirstName,Master.LastName,MasterType.Title_E AS MasterType_E,MasterType.Title_F AS MasterType_F,Video.Url,Video.Numero AS PrimaryKey;
 FROM Program;
 INNER JOIN Master ON Program.NoMaster=Master.Numero;
 INNER JOIN MasterType ON Master.NoMasterT=MasterType.Numero;
 INNER JOIN Video ON Program.Numero=Video.NoProgram;
 INNER JOIN InvoiceI ON Video.Numero=InvoiceI.NoVideo;
 INNER JOIN Invoice ON InvoiceI.NoInvoice=Invoice.Numero;
 WHERE Program.Active AND Invoice.AddUser=1;
 ORDER BY Program.Title
This works well. For each purchased video part of a program, I obtain the program information, the related master information as well as the video information.

What I need to do from this SQL is to get the first video of the program. So, if a program contains video 11, 13, 33, 45 and the user purchases video 13 and 33, I need to obtain 11 because this video ID was created the first one in the program. Based on that SQL result, what can I add to achieve that?
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
Next
Reply
Map
View

Click here to load this message in the networking platform