gpt4 book ai didi

mysql 选择联合所有日期值不正确

转载 作者:行者123 更新时间:2023-11-30 01:13:52 24 4
gpt4 key购买 nike

我将 2 个表 miele 和 confmiele 结合起来,如下所示:

 SELECT datamiele, nomemiele, codicemiele, dataconfmiele, '' AS nomeconfmiele, 
0 AS codiceconfmiele FROM miele
UNION ALL
dataconfmiele, '' AS nomemiele, 0 AS codicemiele, dataconfmiele, nomeconfmiele,
codiceconfmiele
FROM confmiele

结果正确,但字段 datamiele 和 dataconfmiele 不正确(是数据字段类型)

Result il like:
datamiele
323031332d30392d3031

为字段编号分配值 0 或为字段 varchar 分配 varchar 给出正确的值。​​但我不知道日期字段分配什么?

最佳答案

通过映射精确别名来尝试这个

 SELECT datamiele, 
nomemiele,
codicemiele,
dataconfmiele,
'' AS nomeconfmiele,
0 AS codiceconfmiele
FROM miele
UNION ALL
SELECT dataconfmiele AS datamiele,
'' AS nomemiele,
0 AS codicemiele,
dataconfmiele,
nomeconfmiele,
codiceconfmiele
FROM confmiele

关于mysql 选择联合所有日期值不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19247179/

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