gpt4 book ai didi

mysql - 在使用 Mysql cast 函数获取检查 Mysql 版本或正确的语法错误时

转载 作者:行者123 更新时间:2023-11-29 04:46:26 24 4
gpt4 key购买 nike

SELECT EM.rec_id AS rec_id,EM.employee_code, EM.employee_name, EM.designation,   EM.weekly_off_day, EM.gender, EM.payment_type, SM.shift_name, PM.plant_name, EM.status AS status,EM.settlement_no,
SCM.section_name
FROM employee_master AS EM
INNER JOIN shift_master AS SM ON EM.shift_rec_id = SM.rec_id
INNER JOIN section_master AS SCM ON EM.section_rec_id = SCM.rec_id
INNER JOIN plant_master AS PM ON EM.plant_rec_id = PM.rec_id
ORDER BY CAST(EM.employee_code As INT)

这是我正在使用的sql。谢谢

最佳答案

SELECT EM.rec_id AS rec_id,EM.employee_code, EM.employee_name, EM.designation,   EM.weekly_off_day, EM.gender, EM.payment_type, SM.shift_name, PM.plant_name, EM.status AS status,EM.settlement_no,
SCM.section_name
FROM employee_master AS EM
INNER JOIN shift_master AS SM ON EM.shift_rec_id = SM.rec_id
INNER JOIN section_master AS SCM ON EM.section_rec_id = SCM.rec_id
INNER JOIN plant_master AS PM ON EM.plant_rec_id = PM.rec_id
ORDER BY CAST(EM.employee_code As UNSIGNED )

参见 this所以线程

关于mysql - 在使用 Mysql cast 函数获取检查 Mysql 版本或正确的语法错误时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18271971/

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