并排显示比较简单 使用 union可以实现
语法 select 列1,列2 from (
select 列1,列2 from 表1
nuion
select 列1,列2 from 表2
) AS temp

当多个不同查询集需要并列显示时 需要穿件一个动态变量 如下:
语法:
select 表1列名,表2列名 from
(select @[email protected]+1 AS row,表1列 from 表1,(select @i:=0)t)a,
(select @[email protected]+1 AS row,表2列 from 表2,(select @i:=0)t)b,
where a.row=b.row

其中 @[email protected]+1很关键根据数据条数从1开始动态增加使得即使不同表没有想关联的字段可使用它让不同表关联起来 从而实现并列显示
实际效果
mysql 使数据并列和并排显示

相关文章:

  • 2022-12-23
  • 2021-11-04
  • 2022-12-23
  • 2021-11-20
  • 2022-02-01
  • 2022-12-23
  • 2021-12-22
  • 2021-09-04
猜你喜欢
  • 2022-12-23
  • 2021-04-03
  • 2021-11-23
  • 2021-07-28
  • 2022-12-23
  • 2022-12-23
  • 2022-01-30
相关资源
相似解决方案