gpt4 book ai didi

mysql - 选择使用联合查询

转载 作者:行者123 更新时间:2023-11-29 01:13:12 25 4
gpt4 key购买 nike

我写了两个 sql 选择查询并使用“union”加入它。但是输出是混合的。我希望第一个查询首先输出,依此类推。怎么可能。下面给出了我的 SQL fiddle 。

SQLFiddle

最佳答案

尝试使用union all:

select SUBSTR(name, 1, 2) from customer
union all
select SUBSTR(name, 1, 3) from customer
;

关于mysql - 选择使用联合查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29466326/

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