Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
kwacz23
Starting Member
44 Posts |
Posted - 2014-03-19 : 09:03:38
|
Hi How to change below query for JOiNS queryselect * from Sales.Orders awhere a.orderid in ( select max(b.orderid) from sales.orders bwhere b.custid=a.custid)Task : Finad for every user max order IDRegards |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2014-03-19 : 09:26:23
|
select custid, max(orderid) as orderid from sales.orders group by custid Too old to Rock'n'Roll too young to die. |
|
|
sqlsaga
Yak Posting Veteran
93 Posts |
|
|
|
|