|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi people!
I'm trying to put the result of the following request: SELECT 'JR' AS EMPLOYEE ,SUBJECT FROM JOEL UNION SELECT 'JC' AS EMPLOYEE ,SUBJECT FROM JOACHIM; Into a new table, but always getting many errors...if it is possible to do that, where should I put the "into TABLENAME" statement? Thanks for your answers! Tiago |
|
#2
|
|||
|
|||
|
What errors are you getting?
The "INTO TABLE" would come after "SUBJECT" before "FROM JOEL" Alternativately you could do: Code:
INSERT INTO myTable(EMPLOYEE, SUBJECT) SELECT 'JR' AS EMPLOYEE,SUBJECT FROM JOEL UNION SELECT 'JC' AS EMPLOYEE ,SUBJECT FROM JOACHIM |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft SQL Server > get UNION and MAKE-TABLE to work together |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|