Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Sep 5th, 2013  |  syntax: None  |  size: 0.84 KB  |  views: 55  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. SELECT [Theme].[PK_Theme], [Theme].[Name], [ThemeType].[Type]
  2.   FROM [Theme]
  3.   LEFT OUTER JOIN [ThemeType]
  4.     ON [Theme].[ThemeTypeId] = [ThemeType].[PK_ThemeType]
  5.   JOIN [ProductTheme] ON [ProductTheme].[ThemeId]=[Theme].[PK_Theme]
  6.  WHERE ProductTheme.ProductID LIKE '%'
  7.    AND ProductTheme.ThemeId = Theme.PK_Theme
  8.    AND COALESCE([THEME].[THEMETYPEID], 'null') LIKE '%'
  9.  GROUP BY [Theme].[Name], [ThemeType].[Type], [Theme].[PK_Theme]
  10.  ORDER BY CASE WHEN [ThemeType].[Type] IS NULL THEN 0 ELSE 1 END, [Theme].[Name]
  11.        
  12. COALESCE([THEME].[THEMETYPEID], 'null')
  13.        
  14. AND COALESCE([THEME].[THEMETYPEID], 'null') LIKE '%'
  15.        
  16. AND COALESCE(cast([THEME].[THEMETYPEID] as varchar(255)), 'null') LIKE '%'
  17.        
  18. AND [THEME].[THEMETYPEID] is not null
  19.        
  20. AND COALESCE([THEME].[THEMETYPEID], 'null') LIKE '%'
  21.        
  22. AND COALESCE([THEME].[THEMETYPEID], 0) = 0%
clone this paste RAW Paste Data