I need to join three tables and return data that may not be in all three tables

Ads
 

I need to join three tables and return data that may not be in all three tables

How do I join three tables and return information even if it is in only two of the tables

View Answers

December 1, 2010 at 2:13 PM

Hi Friend,

Please visit the following link:

Join Tables

Thanks


December 1, 2010 at 7:22 PM

I have my query setup as the example the issue is I need information to be returned even if it is not in all three tables. Example: I have table A, B and C. A is student names and addresses. B is contact information for students. C is transportation information for students. All students are in table A and table B. In table C only students that have transportation information are in the table. When I run my query with the two left joins and I do not get all the students, I only get the students that are in all three tables. How do I get all the information for students from table A and table B even if they are not in table C? Thanks!


December 1, 2010 at 11:17 PM

I was able to solve this by adding IS NULL for table B and C in the WHERE statement.

Ads









Related Tutorials/Questions & Answers:
select result from three tables using sql.
select result from three tables using sql.  I want to get a result from three tables. i dont how to write the sql query. Please help me. "I want... asdf 102 007 I am not sure, is it possible. but help me. THANKS
Join the two tables in sql
Join the two tables in sql  How to join the two tables in SQL ..and return the value from common column in SQL Database
Advertisements
PHP SQL Right Join
query.  JOIN is used to query data from two or more tables. The right join is used in case of need to return all rows from the right table, even... PHP SQL Right Join      
PHP SQL Left Join
query.  JOIN is used to query data from two or more tables. The left join is used in case of need to return all rows from the left table, even... PHP SQL Left Join      
Mysql Join 3 Tables
) Query to join data of  above 3 Tables created above:- The below Query merge three tables that return you only those selective records present... Mysql Join 3 Tables      
PHP SQL Inner Join
in the sql query. JOIN is used to query data from two or more tables. The inner join is used in the case of need to return rows when there is at least one match in both tables. This is the good example to understand inner join clause because
inserting same data to different tables in oracle
inserting same data to different tables in oracle  Hi there ...! i have to insert un,pwd, to three oracle tables, like admin, user, stud, but i want pickup these table names from a drop down list in html...is there any chance can
inserting same data to different tables in oracle
inserting same data to different tables in oracle  Hi there ...! i have to insert un,pwd, to three oracle tables, like admin, user, stud, but i want pickup these table names from a drop down list in html...is there any chance can
inserting same data to different tables in oracle
inserting same data to different tables in oracle  Hi there ...! i have to insert un,pwd, to three oracle tables, like admin, user, stud, but i want pickup these table names from a drop down list in html...is there any chance can
inserting same data to different tables in oracle
inserting same data to different tables in oracle  Hi there ...! i have to insert un,pwd, to three oracle tables, like admin, user, stud, but i want pickup these table names from a drop down list in html...is there any chance can
inserting same data to different tables in oracle
inserting same data to different tables in oracle  Hi there ...! i have to insert un,pwd, to three oracle tables, like admin, user, stud, but i want pickup these table names from a drop down list in html...is there any chance can
inserting same data to different tables in oracle
inserting same data to different tables in oracle  Hi there ...! i have to insert un,pwd, to three oracle tables, like admin, user, stud, but i want pickup these table names from a drop down list in html...is there any chance can
SQL All Tables
SQL All Tables       SQL All Tables is used to show all the tables in database. Understand with Example The Tutorial illustrate an example from 'SQL All Tables'. To understand
Joining tables using criteria
Joining tables using criteria  How do i join more than three tables and retrieve one column from parent table and count of unique values in a single column from child table,the joined tables must be maintain primary key
i want to show timeline chart for three year in chart..
i want to show timeline chart for three year in chart..  I am using Jfree chart library to display chart in web pages. i want to show three year data in chart in 3 lines for three year in same chart. i am able to show
Using criteria for multiple tables
Using criteria for multiple tables  How to join more than three tables,those tables must be maintain primary key relation ship using Hql criteria & projections
Using criteria for multiple tables
Using criteria for multiple tables  How to join more than three tables,those tables must be maintain primary key relation ship using Hql criteria & projections
Purge Data from Mysql tables
Purge Data from Mysql tables  Hi, i have to write a mysql procedure to purge data from tables. but written procedure clear entire tables data. Please give me the solution for purging data. CREATE DEFINER=`root`@`localhost
Mysql Outer Join
; Mysql Outer Join return you the set of all matching records from both...) Right Outer Join:- This join return you all the records from left table matches with right table. Query to join the data of the above two tables named
ModuleNotFoundError: No module named 'django-data-tables'
ModuleNotFoundError: No module named 'django-data-tables'  Hi, My... named 'django-data-tables' How to remove the ModuleNotFoundError: No module named 'django-data-tables' error? Thanks   Hi, In your
how can i hide and show tables
the code is included below i want to hide the tables initially and after i click go i want to display the tables with result.so any help is appreciated much <..., table will be visible with all the data. <%@page language="java"%> <
I cant get values in MS acces in tables
I cant get values in MS acces in tables   I got problem in sending values from servlet . * i am using ms acces * i cant display my values but der... sta = con.createStatement(); int i=sta.executeUpdate("insert
search in Two Tables to Find data and view by jsp
search in Two Tables to Find data and view by jsp  hi i want search in Two Tables to Find data and view by jsp <%@page import... where accountno='"+acnumber+"'"); if(rs=accountno){ int i=0; while(rs.next
Mysql List Tables
Mysql List Tables       The Tutorial illustrate an example from 'Mysql  List Tables'. To understand this example we use show tables query that return the list
Java Cross Join MySQL
Java Cross Join MySQL In this section we will read about how the two tables... a simple example. Cross Join in SQL joins two tables. These two tables are joined... or records from the two tables. SELECT * FROM table1 CROSS JOIN table2; An image
ModuleNotFoundError: No module named 'three'
ModuleNotFoundError: No module named 'three'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'three' How to remove the ModuleNotFoundError: No module named 'three'
PHP SQL Inner Join
clause in the sql query. The inner join return rows when there is at least one match in both tables. This is the good example to understand inner join clause...;INNER JOIN" keyword is used for join the data. Table: emp Table: message
i want to create website,with manu with three level submenu on top side of page please send me code java
i want to create website,with manu with three level submenu on top side of page please send me code java   iam createing wibsite thats using eclipse andtomcat server,please help me to write menu with three level submenu
Selecting particular data from multiple tables at database and perfoming calculations
Selecting particular data from multiple tables at database and perfoming calculations  Hi fnds, I want to maintain the financial database of 20... the output based on month) .. I have created 12 tables with table name
what is the jsp coding to insert a data in database tables
what is the jsp coding to insert a data in database tables  Dear Sir, I Want to know the coding for insert the data from jsp to oracle database.. my... departmentname and departmentid and click submit i want to save this data in my
Comparing tables
Comparing tables  How to compare two or more tables in the Mysql database using jdbc

Ads