Hi.. I'm kind of new to SQL programming. My environment is using Dreamweaver to access a IBM DB2 DB - basically using the recordset builder to create SQL. I have three tables:
Order Table
Order_Number
Truck_Number
Mobile Table
Device_ID
Assigned_Truck
Location Table
Device
Location_Time
Longitude
Latitude
What I would like to do is show the ORDER NUMBER, ASSIGNED TRUCK, and the most recent (max of) LOCATION_TIME and the LONGITUDE and LATITUDE at that max time.
The relationships are as follows:
Location_Table.Device = Mobile_Table.Device_ID
Mobile_Table.Assigned_Truck = Order_Table.Truck_Number
Can anyone give me some guidance? I can join 2 of the 3 tables.. but that 3rd join is hanging me up. Any assistance would be greatly appreciated.
Order Table
Order_Number
Truck_Number
Mobile Table
Device_ID
Assigned_Truck
Location Table
Device
Location_Time
Longitude
Latitude
What I would like to do is show the ORDER NUMBER, ASSIGNED TRUCK, and the most recent (max of) LOCATION_TIME and the LONGITUDE and LATITUDE at that max time.
The relationships are as follows:
Location_Table.Device = Mobile_Table.Device_ID
Mobile_Table.Assigned_Truck = Order_Table.Truck_Number
Can anyone give me some guidance? I can join 2 of the 3 tables.. but that 3rd join is hanging me up. Any assistance would be greatly appreciated.