Answers for "sql select from multiple tables without join"

SQL
7

join multiple tables sql

SELECT TableA.*, TableB.*, TableC.*, TableD.*
FROM TableA
    JOIN TableB
        ON TableB.aID = TableA.aID
    JOIN TableC
        ON TableC.cID = TableB.cID
    JOIN TableD
        ON TableD.dID = TableA.dID
WHERE DATE(TableC.date)=date(now())
Posted by: Guest on September-27-2020
2

sql select from multiple tables without join

-- UNION: distinct values (slower)
SELECT emp_name AS name from employees
UNION       
SELECT cust_name AS name from customers;

-- UNION ALL: keeps duplicates (faster)
SELECT emp_name AS name from employees
UNION ALL      
SELECT cust_name AS name from customers;
Posted by: Guest on April-22-2021
0

join multiple tables in sql

SELECT Books_Namn, Author_Namn, Author_Age, Store_Namn FROM books

JOIN Author ON Author_Id = Author_Author_Id

JOIN Books_has_Store ON Books_Books_Id = Books_Id

JOIN Store ON Store_Id = Store_Store_Id;
Posted by: Guest on December-01-2020

Code answers related to "sql select from multiple tables without join"

Code answers related to "SQL"

Browse Popular Code Answers by Language