CREATE TABLE `commoncore` (
`id` int(11) unsigned NOT NULL auto_increment,
`CCorder` int(11) default NULL,
`CCIndex` text,
`Standard` text,
`Grade` text,
`Strand` text,
`Cluster` text,
`Standard #` text,
`Cluster2` text,
`importData` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;這是表結構
select * from commoncore limit 0 , 495 可以查出來表的第一條開始 一共495條數據
SELECT Grade FROM `commoncore` where Grade is not null GROUP BY Grade ORDER BY CAST( Grade AS UNSIGNED ) , Grade查出表grade字段 然后排序 我的gade 是text類型的 查出來的結果是k k12 1,2,3,4,5.。。。。。
select com.grade from (select * from commoncore limit 1,495) as com where com.grade is not null group by com.grade order by cast(grade as unsigned),com.grade查出來表的前495條數據 並排序