06. Write a query to display the sales order ID, territory name, month, and year of all the sales orders in the following format.
select salesOrderID 'Territory name'= name,
month = datename(mm,OrderDate),
Year = Datename(yy,orderdate)
from sales.salesOrderHeader s
join sales.salesTerritorey t
on s.TerritoryID =t.TerritoryID
No comments:
Post a Comment