Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Complex SQL Select
Message
From
18/10/2002 01:24:17
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Complex SQL Select
Miscellaneous
Thread ID:
00712719
Message ID:
00712719
Views:
34
I have the following two tables (Purchase and vehicle) in a SQL Server table. Is there a way to produce the result set where it will show the expensive vehilce purchased by a person, using a single SQL Select (it can be nested.) I can bring down both tables in to Fox using SPT and then programmatically find them. But the problem is if the Purchas table is so big, then it will be an issue.

Important Note: This is not my school home work! I just created an example for a real problem I am having now.

Purchase
Person, Vechicle, PuchaseID
A, Car, 1
A, Truck, 2
A, Bike, 3
B, Bike, 4
B, Jet, 5
C, Truck, 6
D, 4WD, 7
D, Bike, 8

Vehicle

Vehicle, Price
Car, 5000
Bike, 100
Truck, 7000
Jet, 30000
4WD,6000


Expected Result Set

Expensive Vehicle
Person ExpensiveVehicle
A Truck
B Jet
C Truck
D 4WD
Next
Reply
Map
View

Click here to load this message in the networking platform