Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在数据库中,是一个表,table,有 3 列,id(自动递增)、title 和 description。
如何获取表中的最后 6 行并将数据发布如下:
<div class="myclass"> <h1>Title</h1> <p>Description</p> </div>
您正在寻找的 SQL 是这样的:
SELECT Title, Description FROM aTable ORDER BY ID Desc LIMIT 6
ORDER BYID 然后使用LIMIT.
ORDER BY
LIMIT