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 |
|
Vipps
Starting Member
4 Posts |
Posted - 2006-09-06 : 08:19:03
|
I Have A problem in a query the problem is that i want to delete all records from m table but not last one.i want to do it with query only.Any 1 Help me. |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-09-06 : 08:20:27
|
| delete from mytable where myprimarykeycolumn <> (select max(myprimarykeycolumn) from mytable)Peter LarssonHelsingborg, Sweden |
 |
|
|
chiragkhabaria
Master Smack Fu Yak Hacker
1907 Posts |
Posted - 2006-09-06 : 08:25:58
|
| delete from [table] t1 where dt <> (select max(dt) From [table] t2 Where t1.pk = t2.pk)Chirag |
 |
|
|
Vipps
Starting Member
4 Posts |
Posted - 2006-09-06 : 08:44:43
|
Thx A Lot PASO Query Works Fine |
 |
|
|
Vipps
Starting Member
4 Posts |
Posted - 2006-09-06 : 08:45:24
|
Thx A Lot Chirag Query Works Fine |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-09-06 : 09:19:52
|
| There is no Last record until you define itMadhivananFailing to plan is Planning to fail |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|
|