通过不工作在MySQL中的临时表排序

时间:2018-11-05 04:32:25

标签: mysql phpmyadmin

我按如下所示在表中获取数据,我想按dDistance排序,我尝试了一些诸如CAST(dDistance为十进制)或CAST(dDistance为FLOAT)的事情。

我也尝试过

select dDistance from yourtable order by dDistance + 0

但根本不起作用

TransmitterPointsData的架构为:

enter image description here

查询如下:

CREATE  TEMPORARY TABLE TempTable Select tpd.Latitude as Latitude ,tpd.Longitude as Longitude,tpd.CoverageID as coverageID from TransmitterPointsData tpd

另一个TempTable DistTable

CREATE TEMPORARY TABLE DistTable select te.Latitude,
    te.Longitude, 
    te.CoverageID,
    POWER((x),2)  as A,
    POWER((z),2)  as C,
    POWER((y),2))) as dDistance,
    from TempTable te;

要获取输出:

SELECT * from DistTable order by CAST(dDistance as DECIMAL) ASC;

我可以看到下表,但看不到按操作顺序

MySql Table

有帮助吗? 谢谢

1 个答案:

答案 0 :(得分:0)

我有解决方案。 我更改了如下的选择语句

Class.forname()