Questions about retrieving only a part of the database

Source: Internet
Author: User
I have a table with the attributes fid, content, and time. Fid is the id of a friend, and content is what a friend says. each friend can say many sentences and many friends. now, if there are many friends and each friend says a lot, how can I retrieve any amount of data by time. Now I can only foreach the fid and retrieve only part of it in the pu database.
I have a table with the attributes fid, content, and time. Fid is the id of a friend, and content is what a friend says. each friend can say many sentences and many friends. now, if there are many friends and each friend says a lot, how can I retrieve any amount of data by time. Now I can only foreach the fid and then push it to a new array, then sort it by time, and then retrieve some of the mid-range values, but this is too inefficient. Is there any other way?

------ Solution --------------------
Are all data retrieved, or a specified number of data retrieved?
------ Solution --------------------
Select fid, content, time from table order by time desc
------ Solution --------------------
Sort by time

Order by time
------ Solution --------------------
We recommend that you paste your table results and your code so that others can know what you want.
------ Solution --------------------
Let's take a look at the issue of key code.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.