我需要加入接下来两个查询的结果:
SELECT EXTRACT( HOUR
FROM (
TIMEDIFF( NOW( ) , (
SELECT MIN( date_cmd )
FROM arc_commande_temp
WHERE id_cmd = '6580' ) )
)
) AS HOURS
SELECT EXTRACT( MINUTE
FROM (
TIMEDIFF( NOW( ) , (
SELECT MIN( date_cmd )
FROM arc_commande_temp
WHERE id_cmd = '6580' ) )
)
) AS MINS
我知道我必须以某种方式加入它们,但是这个提取函数给我带来了很多问题。我有下一个仍然有效的查询
SELECT
*
FROM
(SELECT
MIN(date_cmd) AS HOURS
FROM
arc_commande_temp
WHERE
id_cmd = '6580') AS HOURS,
(SELECT
MIN(date_cmd) AS MINS
FROM
arc_commande_temp
WHERE
id_cmd = '6580') AS MINS
- 这不是我需要的,但我正在尝试修改它以获得我想要的 - 但是当我尝试更改其他内容以构建我需要的查询时......我收到一个错误:-(
提前致谢和问候