Visual basic
SQL server
Version 3.0
December 20th, 2010
SelfServing
I am having a hard time duplicating the following query:
SELECT PBStoreLocations.locDescription, Vendor.VName, DefaultFuel.StoreID, DefaultFuel.Vendor
FROM (DefaultFuel INNER JOIN Vendor ON DefaultFuel.Vendor = Vendor.VCorpVID) INNER JOIN PBStoreLocations ON DefaultFuel.StoreID = PBStoreLocations.locStore
GROUP BY PBStoreLocations.locDescription, Vendor.VName, DefaultFuel.StoreID, DefaultFuel.Vendor;
There are no relations defined at all. Actually the PBStoreLoacations table and the Vendor table are in one database and the DefaultFuel table is in a different one.
DefaultFuel layout is: Vendor layout is: PBStoreLocation layout is:
StoreID VCorpVid LocStore
Vendor VName LocDescription
. . .
. . .
. . .
. . .
etc. etc. etc.
I am going to use the results in a datagrid (read only).
I have looked at the derived tables and dynamic relations document and I am having a hard time with it.
Any help in code would be greatly appreciated.