473,379 Members | 1,520 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,379 software developers and data experts.

Join tables with empty records

Hi all,

I'm trying to join 2 tables as follow

Table 1:
userId Name
1 Tom
2 John

Table 2:
bookId userId Title
1 1 Book1
2 1 Book2

Ultimately, I need a table which shows the record even if it does not have a corresponding record in Table2.

My desired result:
userId Name bookId Title
1 Tom 1 Book1
1 Tom 2 Book2
2 John

I tried to use Join statement but what happened is since userId 2 does not have a record in Table2, it doesnt show in my results. Is there anything i can do to make this works?
Sep 3 '10 #1
1 2896
rski
700 Expert 512MB
Instead join use

Expand|Select|Wrap|Line Numbers
  1. table1 left outer join table2
  2.  
Sep 3 '10 #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...
2
by: ET | last post by:
Hi! I'll need help on what todo with this information in table... There has to be a unique on one column (Item ID, for inventory purpose) but in many cases that ID is not known... thus, many...
2
by: Rico | last post by:
Hello, I'm formatting a report based on an existing controlled document. The document that I'm duplicating has a number of lines that the user fills our manually, but the database version of...
2
by: zwasdl | last post by:
I'm using access to connect to Oracle via ODBC. I can also connect to Oracle via sql*plus. Can I write a query to join tables from different schema? If so, how? Thanks a million! Wei
2
by: =?Utf-8?B?VGVycnk=?= | last post by:
Is it possible to join tables from different databases? If so, what is the format of the select statement? Both databases are on the same server. TIA, -- Terry
1
by: mlangley | last post by:
Hi there. I am trying to figure out a way to create a series of empty records in a database (ACCESS 2003). Basically, the table has 10 years of information by id. However, if there is no ID, then...
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...
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...
2
by: puT3 | last post by:
How can I make the report do not show any empty records? For example, in this table do not has address...I want the report only shows company that has address
4
guillermobytes
by: guillermobytes | last post by:
hi, i was wondering which type of join should i use to get an empty result set when there is no record in one of the tables i.e : i have two tables : Element and Attribute the table Element...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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...

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.