1
如何從此查詢中刪除重複?優化查詢重複
SELECT
*, UNIX_TIMESTAMP(
STR_TO_DATE(
CONCAT(
IFNULL(expected_release_day, 1),
' ',
IFNULL(
expected_release_month,
IFNULL(
3 * expected_release_quarter,
1
)
),
' ',
expected_release_year
),
'%d %m %Y'
)
) calc
FROM
games
WHERE
expected_release_year > 0 && UNIX_TIMESTAMP(
STR_TO_DATE(
CONCAT(
IFNULL(expected_release_day, 1),
' ',
IFNULL(
expected_release_month,
IFNULL(
3 * expected_release_quarter,
1
)
),
' ',
expected_release_year
),
'%d %m %Y'
)
) > UNIX_TIMESTAMP(NOW())
ORDER BY
calc