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 |
|
esthera
Master Smack Fu Yak Hacker
1410 Posts |
Posted - 2007-03-09 : 03:44:52
|
| i know i can say select top 5 customerid,customername from customersbut how can i query to return all but the first recordso if I have in customersname dateesther 3-3esther 3-4esther 3-5johm 3-5esther 3-6esther 3-4I want to return all customers with name esther except the one with the highest date so my query should returnname dateesther 3-3esther 3-4esther 3-5esther 3-4 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2007-03-09 : 04:32:31
|
| one way of doing itselect name, datefrom customerswhere name='esther'and date<(select max(date) from customers where name='esther')--------------------keeping it simple... |
 |
|
|
|
|
|