繁体   English   中英

选择查询以在同一html表的不同行中显示来自多个表的数据

[英]select query to display data from multiple table in different rows with in same html table

我有两个表。第一个表有两列id和bird。 第二个表有两列id和动物名。 如何使用mysql获取此记录并在不同行的html单个表中显示它。

鸟表

动物桌

输出表

你可以做

select 
@r:=@r+1 as id , 
resultdata from 
(
  select birds as resultdata from birds 
  union all 
  select animals as resultdata from animals
)x,(select @r:=0)n;

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM