0

I'm having a table 'Products' and if Execute this query

SELECT TOP 1000 [ProductID]
      ,[ProductDesc]
      ,[ManufacturingDate]
      ,[ExpiryDate]
      ,[Price]
  FROM [TestSat].[dbo].[Products]

I got the output:

enter image description here

and If I use this select query:

SELECT ProductDesc,Price
  FROM [Products]
  WHERE Price>20.00

I got this output:

enter image description here

If I use CTE-Select like this:

 ;WITH ProductsCTE(ProdName,Price) AS
( SELECT ProductDesc,Price
  FROM [Products]
  WHERE Price>20.00
)

I got this output:

enter image description here

The only difference I found between this simple Select Query as well as CTE Select query is the Column name (ProductDesc as ProdName). Does it is the only difference between normal Select query as well as CTE Select query?

Sathiya Kumar V M
  • 219
  • 1
  • 3
  • 15

0 Answers0