请大家帮忙看下mysql排序问题
本帖最后由 developerFBI 于 2013-04-26 08:22:12 编辑 表结构如下:
CREATE TABLE terminalGps(
termiGpsId INT AUTO_INCREMENT PRIMARY KEY,
termiGpsLng VARCHAR(20),
termiGpsLat VARCHAR(20),
termiGpsDate VARCHAR(20),
termiId INT,
termiRemark VARCHAR(100)
)ENGINE=INNODB;
插入的数据:
insert into `terminalGps` (`termiGpsId`, `termiGpsLng`, `termiGpsLat`, `termiGpsDate`, `termiId`, `termiRemark`) values('1','106.540983','29.560692','2013-04-22 12:20:30','4',NULL);
insert into `terminalGps` (`termiGpsId`, `termiGpsLng`, `termiGpsLat`, `termiGpsDate`, `termiId`, `termiRemark`) values('2','106.556956','29.556587','2013-04-22 12:20:30','3',NULL);
insert into `terminalGps` (`termiGpsId`, `termiGpsLng`, `termiGpsLat`, `termiGpsDate`, `termiId`, `termiRemark`) values('3','106.554477','29.563624','2013-04-22 13:20:30','3',NULL);
insert into `terminalGps` (`termiGpsId`, `termiGpsLng`, `termiGpsLat`, `termiGpsDate`, `termiId`, `termiRemark`) values('4','106.548332','29.560231','2013-04-22 12:50:30','2',NULL);
insert into `terminal` (`termiId`, `termiMachineId`, `termiName`, `termiOs`, `termiMacAdress`, `termiRemark`, `termiPort`, `termiIp`) values('3','htc2457884','htcName','Anroid','tt','remark',NULL,NULL);
insert into `terminal` (`termiId`, `termiMachineId`, `termiName`, `termiOs`, `termiMacAdress`, `termiRemark`, `termiPort`, `termiIp`) values('4','nokia14754','nokiaName','Anroid','aa','remark',NULL,NULL);
insert into `terminal` (`termiId`, `termiMachineId`, `termiName`, `termiOs`, `termiMacAdress`, `termiRemark`, `termiPort`, `termiIp`) values('5','ipad31547','ipad3','IOS','541','remark',NULL,NULL);
insert into `terminal` (`termiId`, `termiMachineId`, `termiName`, `termiOs`, `termiMacAdress`, `termiRemark`, `termiPort`, `termiIp`) values('6','hase2541','hase','Android','dsf54','remark',NULL,NULL);
insert into `terminal` (`termiId`, `termiMachineId`, `termiName`, `termiOs`, `termiMacAdress`, `termiRemark`, `termiPort`, `termiIp`) values('7','htc324','htc','Android','dsf5421','remark',NULL,NULL);
insert into `termAndEmpRelation` (`taerId`, `termiId`, `taerDoDate`, `taerBeginDate`, `taerEndDate`, `emplId`, `termiRemark`) values('t41475543','3','2013-1-4','2013-1-4 12:10:20','2013-1-4 18:10:20','345345435346','sdf');
insert into `termAndEmpRelation` (`taerId`, `termiId`, `taerDoDate`, `taerBeginDate`, `taerEndDate`, `emplId`, `termiRemark`) values('t41475544','3','2013-1-4','2013-1-4 12:10:20','2013-1-4 18:10:20','345345435345','sdf');
insert into `employee` (`emplId`, `emplNo`, `emplName`, `emplPwd`, `emplPhoneNum`, `EmplQualifi`, `EmpLat`, `EmpLng`, `EmplRoleId`, `EmplBirth`, `EmplJoinDate`, `EmplRemark`) values('25474454477','xusy','徐士义','32','16865326033','0','29.5595400000','106.5463560000','2','1987-4-5','2013-1-5','remark');
insert into `employee` (`emplId`, `emplNo`, `emplName`, `emplPwd`, `emplPhoneNum`, `EmplQualifi`, `EmpLat`, `EmpLng`, `EmplRoleId`, `EmplBirth`, `EmplJoinDate`, `EmplRemark`) values('324234234234','lichg','倪长贵','43','16853592603','0','29.5649750000','106.5540820000','2','1987-5-5','2013-1-5','remark');
insert into `employee` (`emplId`, `emplNo`, `emplName`, `emplPwd`, `emplPhoneNum`, `EmplQualifi`, `EmpLat`, `EmpLng`, `EmplRoleId`, `EmplBirth`, `EmplJoinDate`, `EmplRemark`) values('3435345345','liuj','刘健','432','16853592603','1','29.5651010000','106.5633520000','3','1987-6-5','2013-1-5','remark');
insert into `employee` (`emplId`, `emplNo`, `emplName`, `emplPwd`, `emplPhoneNum`, `EmplQualifi`, `EmpLat`, `EmpLng`, `EmplRoleId`, `EmplBirth`, `EmplJoinDate`, `EmplRemark`) values('34534534534','zhouxy','周星宇','212','16876592603','1','29.5611420000','106.5478290000','2','1987-8-5','2013-1-5','remark');
insert into `employee` (`emplId`, `emplNo`, `emplName`, `emplPwd`, `emplPhoneNum`, `EmplQualifi`, `EmpLat`, `EmpLng`, `EmplRoleId`, `EmplBirth`, `EmplJoinDate`, `EmplRemark`) values('34534535435','xiaoe','小二','21','1683292603','0','29.5649120000','106.5503450000','1','1988-4-5','2013-1-5','remark');
insert into `employee` (`emplId`, `emplNo`, `emplName`, `emplPwd`, `emplPhoneNum`, `EmplQualifi`, `EmpLat`, `EmpLng`, `EmplRoleId`, `EmplBirth`, `EmplJoinDate`, `EmplRemark`) values('345345435345','tfq','唐富强','123','15823592603','1','29.5606920000','106.5409830000','1','1982-4-5','2013-2-5','remark');
insert into `employee` (`emplId`, `emplNo`, `emplName`, `emplPwd`, `emplPhoneNum`, `EmplQualifi`, `EmpLat`, `EmpLng`, `EmplRoleId`, `EmplBirth`, `EmplJoinDate`, `EmplRemark`) values('345345435346','liuls','刘老师','32','15823592603','1','29.5565870000','106.5569560000','1','1987-4-5','2013-2-5','remark');
insert into `employee` (`emplId`, `emplNo`, `emplName`, `emplPwd`, `emplPhoneNum`, `EmplQualifi`, `EmpLat`, `EmpLng`, `EmplRoleId`, `EmplBirth`, `EmplJoinDate`, `EmplRemark`) values('43533443543','fanls','范老师','343','16853532603','1','29.5636240000','106.5544770000','3','1987-4-5','2013-1-5','remark');
insert into `employee` (`emplId`, `emplNo`, `emplName`, `emplPwd`, `emplPhoneNum`, `EmplQualifi`, `EmpLat`, `EmpLng`, `EmplRoleId`, `EmplBirth`, `EmplJoinDate`, `EmplRemark`) values('45465454654','lishi','李四','23','15432292603','0','29.5602310000','106.5483320000','1','1987-4-5','2013-1-5','remark');