I have three tables called STOCK,REGIONS AND STOCK.
REGIONS table have following fields,
- id
- Region
LOCATIONS table have following fields,
- id
- Location
and STOCK table has fields called,
- region
- location
- chassisNo
- shipment_No
... etc.
When inserting data to the STOCK table I only insert the id corresponding to the Region and Location (Not the names).
Names and id`s of regions and locations are stored in the REGIONS and LOCATIONS tables.
I want to select a result set from stock table where below condition becomes true.
Select * from STOCK where chassisNo like '<some thing>' and shipment_No is NULL.
But this will give me id`s of region, location from stock table. But I want names of region and location instead of just id.( so what I want is to some how connect this result with REGIONS and LOCATIONS tables to get the names)
I know this happen because only id`s are stored in the stock table.
FINAL RESULT WHAT I WANT
REGIONS.Region | LOCATIONS.Location | STOCK.chassisNo | STOCK.shipment_No
Can anyone pls help me with building this query. I will be deeply appreciated if any one can help me.
thank you.