Union Clause

SELECT * from products where product_id = '1' 
UNION 
SELECT username, 2 from passwords
MariaDB [employees]> select * from employees limit 1;
+--------+------------+------------+-----------+--------+------------+
| emp_no | birth_date | first_name | last_name | gender | hire_date  |
+--------+------------+------------+-----------+--------+------------+
|  10001 | 1953-09-02 | Georgi     | Facello   | M      | 1986-06-26 |
+--------+------------+------------+-----------+--------+------------+
1 row in set (0.182 sec)
MariaDB [employees]> select * from departments limit 1;
+---------+------------------+
| dept_no | dept_name        |
+---------+------------------+
| d009    | Customer Service |
+---------+------------------+
1 row in set (0.181 sec)
SELECT emp_no, first_name from employees
UNION 
SELECT * from departments

Last updated