top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How Does Full Join Work in SQL?

0 votes
764 views
How Does Full Join Work in SQL?
posted Jul 15, 2014 by Rahul Mahajan

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button
check the following link should be helpful. http://tech.queryhome.com/48381/join-operation-in-sql-mysql

2 Answers

+1 vote

The FULL OUTER JOIN keyword combines the result of both LEFT and RIGHT joins.

Its syntax is as follows:
SELECT column_name(s)
FROM table1
FULL OUTER JOIN table2
ON table1.column_name=table2.column_name;

The FULL OUTER JOIN keyword will return all the rows from the left table and all the rows from the right table . If there are rows in table1 that do not have matches in table2 , or if there are rows in table2 that do not have matches in table1 , those rows will be listed as well(as Null).

answer Jul 16, 2014 by Mohit Sharma
+1 vote
SELECT * FROM Employee AS E FULL OUTER JOIN Category AS C ON E.EmployeeID=C.CategoryID
answer Nov 17, 2014 by Manikandan J
need some explanation it should be use....
Similar Questions
+1 vote

I am tring to create a new table into the database if the table name given is not present in database using Php .
This is the code that I am using .

  $conn = mysql_connect($dbhost, $dbuser, $dbpass);
    if(!$conn)
    {
            die('Failed to connect to server: ' . mysql_error());
            exit;
    }
    $db_selected = mysql_select_db($dbname);
    if(!$db_selected)
    {
           $db_selected = " CREATE DATABASE $dbname ";
    }
    $usertb1 = mysql_query("select 1 from $usertb LIMIT 1");
    if( $usertb1 !== FALSE )
    {
           $sql = "CREATE TABLE IF NOT EXISTS $usertb ( uid INT(20) AUTO_INCREMENT UNIQUE KEY NOT NULL,name VARCHAR(40),email varchar(40) PRIMARY KEY NOT NULL)";
    }
    $typetb1 = mysql_query("select 1 from $typetb LIMIT 1");
    if( $typetb1 !== FALSE)
    {
           $sql1 = "CREATE TABLE IF NOT EXISTS $typetb( uid INT(20) NOT NULL, type ENUM('WEB','APP','CART') NOT NULL ,unsubscribe TINYINT(1) NOT NULL,bounce TINYINT(1) NOT NULL,complaint TINYINT(1) NOT NULL, PRIMARY KEY (uid,type), FOREIGN KEY(uid) WHERE promo_user(uid))";
    }
...