morinia
asked on
Select statement in SQL to create a new table
I would like to create a new table D from all elements in table A, all elements in Table B but only two elements from Table C. The two elements are Element_A and Element_B.
Can someone tell me the most efficient way to code this statement.
Can someone tell me the most efficient way to code this statement.
ASKER
matthespatrick
The statement I have below is creating table ER_Members_Cases. The way it is coded now I am getting all of the columns from both Case_Members and ER_Case. I was wondering if there was a way other than listing all of the columns to get all of the columns from one table using the * and only two columns from the other table. FYI this is a PROC statment in SAS using PROC SQL
Create Table ER_Members_Cases as
Select * From Case_Members m, ER_Case e
where m.membno = e.membno;
Quit;
The statement I have below is creating table ER_Members_Cases. The way it is coded now I am getting all of the columns from both Case_Members and ER_Case. I was wondering if there was a way other than listing all of the columns to get all of the columns from one table using the * and only two columns from the other table. FYI this is a PROC statment in SAS using PROC SQL
Create Table ER_Members_Cases as
Select * From Case_Members m, ER_Case e
where m.membno = e.membno;
Quit;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SELECT <columns>
INTO NewTableName
FROM <tables>
WHERE <criteria>
Your question does not really provide enough information to go much beyond that.