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