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 |
|
vandana
Starting Member
29 Posts |
Posted - 2013-01-16 : 04:56:28
|
| Hi, i have a table with 3 columns (cname,sales,date) i want to know the latest sales of particular customer can anyone suggest me the query to do thisThanks in advance |
|
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2013-01-16 : 05:56:39
|
| SELECT TOP 1 WITH TIES * FROM YourTableWHERE cname = @CustomerNameORDER BY date DESC--Chandu |
 |
|
|
vandana
Starting Member
29 Posts |
Posted - 2013-01-16 : 06:07:09
|
| Thanks chandhu it worked !!!! |
 |
|
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2013-01-16 : 06:53:41
|
quote: Originally posted by vandana Thanks chandhu it worked !!!!
Welcome --Chandu |
 |
|
|
|
|
|