I work with SQL Server 2008. I have a table Orders (orderid, orderdate, custid, empid). I need write a query that calculates a row number for each order based on orderdate, orderid ordering. I should do it using derived table. My leader saus that
query isn't correct:
select * from
SELECT orderid, orderdate, custid, empid,
ROW_NUMBER() OVER (PARTITION BY orderdate ORDER BY orderid) rownum
How should I write it?
View Complete Post