Questions about the maximum number of queries-php Tutorial

Source: Internet
Author: User
When the maximum number of queries is encountered, two namenumname fields in the data table field are stored, for example, aabbcc, and so on. The name num field is stored in a: 4: {I: 2009; s: 1: & quot; 0 & quot; I: 2010; s: 1: & quot; 0 & quot; I: 2011; s: 1: & quot; 0 & quot; I: 2012; s: 1: & quot; 1 & quot;} this type of serial field is deserialized, and the maximum number of queries is encountered.
Two data table fields

Name num


Name field, such as aa bb cc, etc.

Num field stores a: 4: {I: 2009; s: 1: "0"; I: 2010; s: 1: "0"; I: 2011; s: 1: "0"; I: 2012; s: 1: "1 ";}

This sequence field
After deserialization
Array (
'20140901' => 0,
'20140901' => 0,
'20140901' => 0,
'20140901' => 1
)
The value is 1.

Then, the operation is to query the first 10 records with the maximum num value,

How to do it?

------ Solution --------------------
If it is a mysql database, it can only be retrieved and sorted by program
However, if the sum has been obtained at the time of warehouse receiving, the mysql function can be used for analysis.

If it is an sqlite database, you can register a php function for it
------ Solution --------------------
Saving json is a tragedy. Use php.
------ Solution --------------------
Test the program end.
------ Solution --------------------
Retrieve all for judgment

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.