Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need advice on SQL
Message
From
17/09/2006 12:19:49
 
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:
01154477
Views:
10
>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.

After more adjustments, I succeeded in making this work with this approach. However, I cannot include my memo fields in the query because those cannot be encapsulated with the MIN() syntax:
SELECT Program.Numero,MIN(Program.Title) AS Title,MIN(Video.Numero);
 FROM Program;
 INNER JOIN Video ON Program.Numero=Video.NoProgram;
 INNER JOIN Master ON Program.NoMaster=Master.Numero;
 INNER JOIN MasterType ON Master.NoMasterT=MasterType.Numero;
 WHERE Program.Active AND Program.Numero IN;
  (SELECT Program2.Numero FROM Program Program2;
  INNER JOIN Video Video2 ON Program2.Numero=Video2.NoProgram;
  INNER JOIN InvoiceI ON Video2.Numero=InvoiceI.NoVideo;
  INNER JOIN Invoice ON InvoiceI.NoInvoice=Invoice.Numero AND Invoice.AddUser=1);
 ORDER BY 2;
 GROUP BY Program.Numero
What can I do in order to include my memo fields in this query?
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
Next
Reply
Map
View

Click here to load this message in the networking platform