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 |
|
anandbohra
Starting Member
4 Posts |
Posted - 2007-07-10 : 07:22:42
|
| Dear all i am having a SQL table which contains fields scrip,price,ddatenow i want to see only those records where date is max of all dates.pl give me syntax for the same select * from tblnsecmbhav_1 having max(ddate) the above one giving me errorAnand Manmohan Bohra |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-07-10 : 07:25:48
|
[code]SELECT scrip, price, ddateFROM tblnsecmbhav_1WHERE ddate = (SELECT MAX(ddate) FROM tblnsecmbhav_1)[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-07-10 : 08:43:19
|
| orSelect top 1 columns from tableorder by datecol descMadhivananFailing to plan is Planning to fail |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-07-10 : 09:30:22
|
quote: now i want to see only those records where date is max of all dates.
TOP 1 only give one record. The OP said records  KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|