473,396 Members | 2,011 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Join 2 tables, and preserve multiple entries for the 1 ID

I am working with some data for an automotive manufacturer and I want to create a dataset which includes every vehicle sale, and every vehicle service in the last 2 years.

In my sales table, I have a list of all of the vehicle serial numbers and the purchase date.

In my Vehicle Service table, I have every Service booked in a period of time, including the vehicle Serial number, the service date, and the cost.

How can I combine these so that I will preserve all of the service entries (either every service entry has a row, or it's own column)? My preference would be for the adding of the service data, to just create a duplicate Sales entry for it to attach to ie. Add rows where multiple services for the same vehicle serial number exist.

Not every vehicle in the Sales table will have corresponding services, but every service entry should be able to be linked to a sales entry.
Feb 13 '20 #1
1 2009
Rabbit
12,516 Expert Mod 8TB
You're looking for an outer join. A left or right outer join selects all records from one table and all potential matching records from a second table. If the second table has no matching record, then those fields from that table will be null.
Feb 13 '20 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Daniel Rossi | last post by:
Hi there i am trying to work out the most efficient way to list say multipl= e categories of entries, the database is quite large about 200 meg.=20 I would like to know if using join tables is...
1
by: Job Lot | last post by:
I have tow columns in my DataTable Date, Amount. What would be the best way to create multiple entries in my DataTable? I am given a start date, end date and an amount. I want to create multiple...
1
by: ccr | last post by:
Please view in a text editor so that the columnar text lines up. I used Terminal 9pt font to compose this post and copied/pasted to my newsreader program. I am writing in the hope that one of...
1
by: ccr | last post by:
Reposted with a longer line length. Apologies if I did not cancel the 1st attempt before you got it. If necessary, please view in a text editor so the columnar text lines up. I used Terminal...
3
by: Bernard Lebel | last post by:
Hello, Is there an option or a way to allow the selection of multiple entries in the Listbox widget? I could not find any, and would like to allow the end user to select multiple entries. ...
8
by: Kasghost | last post by:
I am trying to create a DB in Access 2007 where the values in certain fields requires multiple entries. I would like to send this DB out as an HTML to my techs and have them fill the information...
21
patjones
by: patjones | last post by:
Hi all: My newest project involves creating a small help desk database for our customer service division to use. What will happen is that an employee will call up, explain his/her issue, and...
7
by: Birky | last post by:
All, I have scrubbed the archives to see if someone else has requested this type of help but I have not been able to find anything that fits this scenario. I have a form (which is working...
10
by: Phillipe | last post by:
Hi, hope you can help with this query as it's had me stuck for quite a while. I have two tables: user table ----------------- id (primary key) firstname lastname
0
by: fantabk | last post by:
Hello, I have 2 tables that I need to join and update, the query look like bellow: UPDATE M1L INNER JOIN M1 ON (M1L.A1 = M1.A2) SET M1L.A3 = . WHERE xxx; In M1, we have multiple records...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.