there is no "last record"

回答: SQL statement about going totryyyyyy2004-06-30 17:14:08

what is a table? a table is a set of records.
what is a set? a set is a bunch of similar items in no particular order.

it does not any make sense to say "last record" w/o a sort order.

if you want to track the record you last inserted, you need to use a auto increment id field. then use "top 1" and "order by id desc" clauses to get the last inserted record.

所有跟帖: 

Solutions for future ... -DBDB- 给 DBDB 发送悄悄话 (361 bytes) () 06/30/2004 postreply 20:20:58

回复:there is no "last record" -tryyyyyy- 给 tryyyyyy 发送悄悄话 (47 bytes) () 06/30/2004 postreply 20:45:40

回复:there is no "last record" -tryyyyyy- 给 tryyyyyy 发送悄悄话 (82 bytes) () 06/30/2004 postreply 21:55:46

This is for SQL Server, not -smartll- 给 smartll 发送悄悄话 (60 bytes) () 07/01/2004 postreply 01:02:23

It work in Access -tryyyyyy- 给 tryyyyyy 发送悄悄话 (0 bytes) () 07/01/2004 postreply 07:01:29

回复:回复:there is no "last record" -MD/PHD/IT- 给 MD/PHD/IT 发送悄悄话 (213 bytes) () 07/01/2004 postreply 13:35:43

请您先登陆,再发跟帖!