Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. SELECT TOP (10)
  2. [Join1].[Id1] AS [Id],
  3. [Join1].[Name] AS [Name],
  4. [Join1].[Price] AS [Price],
  5. [Join1].[NewPrice] AS [NewPrice],
  6. [Join1].[ShortDescription] AS [ShortDescription],
  7. [Join1].[SKU] AS [SKU],
  8. [Join1].[ProductTypeID] AS [ProductTypeID],
  9. [Join1].[ImageID] AS [ImageID],
  10. [Join1].[Promotion] AS [Promotion],
  11. [Join1].[ParentID] AS [ParentID],
  12. [Join1].[Attributes] AS [Attributes],
  13. [Join1].[Id2] AS [Id1],
  14. [Join1].[Path] AS [Path]
  15. FROM (
  16. SELECT [Extent1].[Id] AS [Id1]
  17. , [Extent1].[Name] AS [Name]
  18. , [Extent1].[Price] AS [Price]
  19. , [Extent1].[NewPrice] AS [NewPrice]
  20. , [Extent1].[ShortDescription] AS [ShortDescription]
  21. , [Extent1].[SKU] AS [SKU]
  22. , [Extent1].[ProductTypeID] AS [ProductTypeID]
  23. , [Extent1].[ImageID] AS [ImageID]
  24. , [Extent1].[Promotion] AS [Promotion]
  25. , [Extent1].[ParentID] AS [ParentID]
  26. , [Extent1].[Attributes] AS [Attributes]
  27. , [Extent2].[Id] AS [Id2]
  28. , [Extent2].[Path] AS [Path]
  29. , row_number() OVER (ORDER BY [Extent1].[Id] ASC) AS [row_number]
  30. FROM [dbo].[Products] AS [Extent1]
  31. INNER JOIN [dbo].[Images] AS [Extent2] ON [Extent1].[ImageID] = [Extent2].[Id]
  32. ) AS [Join1]
  33. WHERE [Join1].[row_number] > 0
  34. ORDER BY [Join1].[Id1] ASC
  35.  
  36. SELECT TOP (10)
  37. [Join1].[Id1] AS [Id],
  38. [Join1].[Name] AS [Name],
  39. [Join1].[Price] AS [Price],
  40. [Join1].[NewPrice] AS [NewPrice],
  41. [Join1].[ShortDescription] AS [ShortDescription],
  42. [Join1].[SKU] AS [SKU],
  43. [Join1].[ProductTypeID] AS [ProductTypeID],
  44. [Join1].[ImageID] AS [ImageID],
  45. [Join1].[Promotion] AS [Promotion],
  46. [Join1].[ParentID] AS [ParentID],
  47. [Join1].[Attributes] AS [Attributes],
  48. [Join2].[Id] AS [Id2],
  49. [Join2].[Path] AS [Path]
  50. FROM (SELECT
  51. [Extent1].[Id] AS [Id1],
  52. [Extent1].[Name] AS [Name],
  53. [Extent1].[Price] AS [Price],
  54. [Extent1].[NewPrice] AS [NewPrice],
  55. [Extent1].[ShortDescription] AS [ShortDescription],
  56. [Extent1].[SKU] AS [SKU],
  57. [Extent1].[ProductTypeID] AS [ProductTypeID],
  58. [Extent1].[ImageID] AS [ImageID],
  59. [Extent1].[Promotion] AS [Promotion],
  60. [Extent1].[ParentID] AS [ParentID],
  61. [Extent1].[Attributes] AS [Attributes],
  62. ROW_NUMBER() OVER (ORDER BY [Extent1].[Id] ASC) AS [row_number]
  63. FROM [dbo].[Products] AS [Extent1]) AS [Join1]
  64. INNER JOIN [dbo].[Images] AS [Join2] ON [Join1].[ImageID] = [Join2].[Id]
  65. WHERE [Join1].[row_number] > 0
  66. ORDER BY [Join1].[Id1] ASC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement