Search
 
SCRIPT & CODE EXAMPLE
 

SQL

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;
Comment

PREVIOUS NEXT
Code Example
Sql :: sql last time database was accessed 
Sql :: calculate date and convert to yearsmysql 
Sql :: mysql query where in 
Sql :: How to get last inserted primary key in SQL Server 
Sql :: uninstall mysql ubuntu 18.04 stackoverflow 
Sql :: oracle list primary key 
Sql :: truncate psql 
Sql :: select the date 30 days less that the todays date sql request 
Sql :: mysql timestamp vs datetime 
Sql :: sql find leading space 
Sql :: mysql get max value and id 
Sql :: add column alter table default value 
Sql :: SQL Remove Primary Key Constraint - MySQL 
Sql :: unique in sql server 
Sql :: mysql not starting in xampp 
Sql :: substring sql 
Sql :: change from not null postgresql 
Sql :: how to create a table based on another table in mysql 
Sql :: insert many to many sql 
Sql :: delete all duplicate rows keep the latest except for one in mysql 
Sql :: connecting to postgresql on windows amd ubuntu 20.04 
Sql :: query to find third highest salary 
Sql :: delete from select postgresql 
Sql :: sqlalchemy get ids 
Sql :: sqlite update query python 
Sql :: while in sql server 
Sql :: sql select data type of query 
Sql :: first mysql 
Sql :: sql select like 
Sql :: postgresql find missing id 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =