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

請您先登陸,再發跟帖!