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 |
|
regent
Starting Member
1 Post |
Posted - 2003-06-15 : 22:26:36
|
| Consider my table columns is "CUST_NO" and "PURCH_DATE" :I need to compose a query wich retreive a list of custumers no but only one row per CUST_NO and I want to have the most recent PURCH_DATE.THANKS !Sample :My table :CUST_NO | PURCH_DATE1 | 2001-02-142 | 2001-04-183 | 2002-02-142 | 2002-11-054 | 2003-08-271 | 2003-09-12I want query to have this :CUST_NO | PURCH_DATE1 | 2003-09-122 | 2002-11-053 | 2002-02-144 | 2003-08-27 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2003-06-15 : 22:32:31
|
| SELECT Cust_no, Max(Purch_Date) AS Purch_DateFROM myTableGROUP BY Cust_No |
 |
|
|
|
|
|