This topic has been archived. It cannot be replied.
-
工作学习 / IT技术讨论 / 如何选出最近的三个记录从一个TABLE, 如果没有三个,就找出最近的两个基本点或一个.
谢谢
-waiting(OK);
2003-8-11
(#1327606@0)
-
Let me clarify this question. How to get the last three records
-waiting(OK);
2003-8-11
(#1327668@0)
-
what kind of db system r u using?
-yangn(Raymond);
2003-8-11
(#1327689@0)
-
postgres, I think sql syntax is similiar with MS sql
-waiting(OK);
2003-8-11
(#1327737@0)
-
I am not familiar with the system you mentioned. in MS SQL, you may use the following statement:
select top 3 * from table1 order by timestamp_column desc
-yangn(Raymond);
2003-8-11
(#1327747@0)