Skip to content

Instantly share code, notes, and snippets.

@jpcaparas
Created June 30, 2016 21:13
Show Gist options
  • Save jpcaparas/8e1029e3cb99de2623d3865adb7d9b93 to your computer and use it in GitHub Desktop.
Save jpcaparas/8e1029e3cb99de2623d3865adb7d9b93 to your computer and use it in GitHub Desktop.
/**
Fetch a page based on its ID:
Fields required:
- Title
- Description
- Thumbnail
- Section/category
TODO: On the where clause, specify page ID
**/
SELECT
[Page].[Title]
,[Page].[MetaDescription] as Description
,[Page].[Image1]
,[Page].[Image2]
,[Page].[Image3]
,[Page].[Image4]
FROM [CMS_SAL_DEV].[CMS].[Page] [Page]
LEFT JOIN [CMS_SAL_DEV].[CMS].[PageType] PageType
ON [Page].[PageTypeID] = [PageType].[PageTypeID]
WHERE [Page].[PageID] = 1
ORDER BY [Page].[Created] DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment