Forumchem - Forum with AI(ALICE BOT & HAL9000) and TTS

More dificult for us, more easy for you
It is currently Tue Apr 23, 2024 6:29 am

All times are UTC





Post new topic Reply to topic  Page 1 of 1
 [ 1 post ] 
Author Message
 Post subject: Need help writing a SQL query?
PostPosted: Fri Mar 26, 2021 1:33 am 
Offline
User avatar

Joined: Mon Oct 12, 2009 4:26 am
Posts: 19
I need some help writing a query in SQL. The purpose of the query is to list which of our vehicles are compatible with each part in our database.

Here are the tables involved and the relevant columns:

-=Parts=-
PartNumber
Notes

-=WoParts=- [A.K.A. Parts Used on Work Orders]
RecordID (PK)
PartNumber

-=WorkOrders=-
RecordID (PK)
VehKey (FK)

-=Vehicles=-
RecordID (PK)
vehicle
VIN

I m trying to get a query to

1. Go through Parts.PartNumber one row at a time,
2. Running a query for all WoPart.RecordID s where Parts.PartNumber = WoPart.PartNumber,
3. Take 2 and run a query for all WorkOrders.RecordID = WoPart.RecordID,
4. Take WorkOrders.VehKey from the row of each matching WorkOrders.RecordID, displaying only distinct VehKeys,
5. Take 4 and query all Vehicles.VIN where Vehicle.RecordID = WorkOrders.VehKey, sorted by vehicle,
6. Take 5 , go back to the Parts.Notes and update the relevant section of the part s notes field.



Top
 Profile      
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  Page 1 of 1
 [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: vawceix and 3 guests


 
Search for:
 
Jump to:  

cron
Click me:
Powered by phpBB © 2000, 2002, 2005, 2007, 2008, 2009 phpBB Group
Chronicles phpBB3 theme by Jakob Persson. Stone textures by Patty Herford.
With special thanks to RuneVillage

This site have 4 type of tecnology in order to convert text to speech. By default you use the vozme tecnology. In order to know the other you need to sign for.


- Privacy Policy -