Last active
May 25, 2016 23:58
-
-
Save greggnakamura/79c7afd86eeab1ce7a02e09926cd4747 to your computer and use it in GitHub Desktop.
SQL: UNION two tables with no relationship, number of columns must match
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT [AlertTitle] AS Title | |
,'' AS Summary | |
,[AlertBody] AS Description | |
,[AlertDate] AS Date | |
,[AlertLink] AS AlertLink | |
,[AlertType] AS AlertType | |
,'' AS Location | |
FROM [Claremont_Kentico8_2].[dbo].[View_claremont_Alert_Joined] | |
UNION | |
SELECT [EventName] AS Title | |
,[EventSummary] AS Summary | |
,[EventDetails] AS Description | |
,[EventDate] AS Date | |
,'' AS AlertLink | |
,'' AS AlertType | |
,[EventLocation] AS Location | |
FROM [Claremont_Kentico8_2].[dbo].[View_CONTENT_Event_Joined] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment