gpt4 book ai didi

mysql - SQL查询在一个日期之后返回数据。日期设置为 varchar

转载 作者:行者123 更新时间:2023-11-30 23:10:40 26 4
gpt4 key购买 nike

尝试运行将在特定日期后返回所有数据的查询。日期设置为 varchar 而不是日期。

我有:

SELECT employee_id, emp_firstname, emp_lastname, custom79 AS  'First Pay Date', custom6 AS  'Agency', custom56 AS  'Country of Homebase'
FROM `hs_hr_employee`
WHERE custom6 LIKE 'Brookfield'
AND custom61 LIKE 'active-oam'
AND custom79 > '13-07-2012'

帮助会很好,因为我不确定如何为查询转换为日期

使用 UNIX、phpmyadmin、sql

最佳答案

像这样尝试:

SELECT employee_id, emp_firstname, emp_lastname, custom79 AS  'First Pay Date', custom6 AS  'Agency', custom56 AS  'Country of Homebase'
FROM `hs_hr_employee`
WHERE custom6 LIKE 'Brookfield'
AND custom61 LIKE 'active-oam'
AND STR_TO_DATE(custom79, '%d-%m-%Y') > '2012-07-13'

关于mysql - SQL查询在一个日期之后返回数据。日期设置为 varchar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19882226/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com