informix如何查询第一条记录

时间:2021-01-10 00:26:31

1.select first 1 * from shop;    正序查询第一条数据

 

2.select first 1 * from shop order by create_time desc;    按创建时间倒序查询第一条数据

 

3.select first 1 shopid from shop;    正序查询第一条数据中的shopid字段

 

4.select first 1 shopid from shop order by create_time desc;    按创建时间倒序查询第一条数据的shopid字段