-2

我有以下查询,我需要从 MSSQL 转换为 MYSQL

select TOP 7500 Verdunster1B_Digital.LocalCol,
       Verdunster1B_Digital.Funktion_Heizband_Verdunster1B,
       Maschinenraum_Digital.Funktion_Ventilatoren_Verdampfer_Msr,
       Maschinenraum_Digital.Funktion_Glykolpumpe1_Tankverbindung
from Verdunster1B_Digital
  inner join Maschinenraum_Digital 
          on DateAdd (Millisecond,- DatePart (Millisecond,Maschinenraum_Digital.LocalCol),Maschinenraum_Digital.LocalCol) = DateAdd (Millisecond,- DatePart (Millisecond,Verdunster1B_Digital.LocalCol),Verdunster1B_Digital.LocalCol)
where Verdunster1B_Digital.LocalCol between '2013-06-09T00:00:00' and '2013-06-10T00:00:00'
and   Verdunster1B_Digital.ReasonCol = 'Zeit Ein'
and   (   MINUTE (Verdunster1B_Digital.LocalCol) = 0 
       or MINUTE (Verdunster1B_Digital.LocalCol) = 15 
       or MINUTE (Verdunster1B_Digital.LocalCol) = 30 
       or MINUTE (Verdunster1B_Digital.LocalCol) = 45)

它使用了我以前从未见过或使用过的命令,而且我尝试过的所有东西都不起作用。非常欢迎将其转换为 mysql 查询的任何帮助。

谢谢!

4

1 回答 1

0

试试这个——

SELECT
      v.LocalCol
    , v.Funktion_Heizband_Verdunster1B
    , m.Funktion_Ventilatoren_Verdampfer_Msr
    , m.Funktion_Glykolpumpe1_Tankverbindung
FROM Verdunster1B_Digital AS v
JOIN Maschinenraum_Digital AS m ON m.LocalCol = v.LocalCol
WHERE v.LocalCol BETWEEN '20130609' AND '20130610' 
      AND v.ReasonCol = 'Zeit Ein' 
      AND MINUTE(v.LocalCol) IN (0, 15, 30, 45)
LIMIT 0, 7500
于 2013-06-10T08:37:35.367 回答