SELECT orderid, orderdate, empid, custid, (SELECT MAX(O2.orderid) FROM Sales.Orders AS O2 WHERE O2.orderid < O1.orderid) AS prevorderid FROM Sales.Orders AS O1;
10/12/2013
Subscribe to:
Post Comments (Atom)
Blog đang chỉnh sửa
SELECT orderid, orderdate, empid, custid, (SELECT MAX(O2.orderid) FROM Sales.Orders AS O2 WHERE O2.orderid < O1.orderid) AS prevorderid FROM Sales.Orders AS O1;
0 comments:
Post a Comment