I am trying to create a temporary table where it has two fields (user,pass) which was a combination from three tables
TABLES
agents
username | password
clients
username | password
admin
username | password
i want their data from their fields to be stored to a temporary table
TEMPORARY TABLE
temp_tbl
username | password
This is my MySQL query (i know this is a wrong syntax)
CREATE TEMPORARY TABLE temp_tbl ENGINE=MEMORY
AS (SELECT username,password FROM agents UNION SELECT username,password FROM clients UNION SELECT username,password FROM admin) AS col1, col2;