sql如何查詢表的第一條記錄和最後一條記錄

問題: sql如何查詢表的第一條記錄和最後一條記錄mysql 方法一:使用top select TOP 1 * from apple; select TOP 1 * from apple order by id desc; (備註:top是Access的語法,MySQL不支持)web 方法二:使用LIMIT 第一條記錄sql mysql> select * from apple LIMIT 1;
相關文章
相關標籤/搜索