mysql - 如何删除 MySql 子查询中的冗余数据
问题描述
我有两个表,并且有 Mysql 查询
select x.column1 as 'id', y.column1 as 'name' from (select id from table1 limit 1) as x, (select name from table2 limit 5) as y;
在上述情况下,子查询 1 返回 1 行,子查询 2 返回 5 行,输出如下
id name
101 AAA
101 BBB
101 CCC
101 DDD
101 EEE
但我的期望就像
id name
101 AAA
null BBB
null CCC
null DDD
null EEE
如何在 MySql 中获得此输出?提前致谢。
解决方案
推荐阅读
- python - Python 将此 utf8 字符串转换为 latin1
- ios - Bootstrap 4 选项卡在 iOS 上无法使用“data-target”而不是“href”属性
- android - 在活动过渡之间,使背景固定
- angularjs - angular.module(...).provider(...).info 不是函数
- asp.net - 将 web.config 文件存储在不同的文件夹中
- android - 在 ListView 适配器中初始化空的 EditText
- windows - 如何访问 USB 指纹读取器的输出?
- javascript - 在选择标签中选择选项时如何显示单选框或文本框?
- eclipse - 打开 Eclipse 时出现不支持的内容类型的错误消息
- javascript - 在危险的SetInnerHTML 中传递反应组件