我是 MySQL 语法的新手,请帮忙。
更新查询:
$query = mysql_query("SELECT campaign, team, employeeName, shiftcode, scheduleDate,STR_TO_DATE(scheduleIn,'%h:%i %p') as ScheduleIn, STR_TO_DATE(scheduleOut,'%h:%i %p') as ScheduleOut, STR_TO_DATE(MID(scheduleIn,7,4), '%h:%i') as sIn FROM tbl_uploadedschedule WHERE NOT EXISTS(SELECT scOrigtimein, scOrigtimeout FROM tbl_shiftcode WHERE STR_TO_DATE(tbl_uploadedschedule.scheduleIn,'%h:%i %p') = tbl_shiftcode.scOrigtimein or STR_TO_DATE(tbl_uploadedschedule.scheduleOut,'%h:%i %p')=tbl_shiftcode.scOrigtimeOut )") or die(mysql_error());
但它什么也不返回,不知道 STR_TO_DATE() 是否在 WHERE 子句中不能正常工作