I would like to ask Mysql different fields have different records to return, how to query if you want to put them together?

A table field has 3 records returned by separate query
B table field alone query has 8 records returned
currently these two tables have no primary key and foreign key
if you want to combine, how should the structure of the table be designed and how should the model be built

Jun.05,2022

select a as a1,b as a2 ,c as a3 from t1 where xx=xx
union 
select b1 as a1,b2 as a2 ,b3 as a3 from t1 where xx=xx

Menu