开发者

MYSQL GROUP BY 2 Tables

开发者 https://www.devze.com 2023-04-11 09:05 出处:网络
I have 2 tables: games softwares And I have the rows: games开发者_JS百科: id | ref_id | title 1 |20|nikita

I have 2 tables:

games
softwares

And I have the rows:

games开发者_JS百科:

id | ref_id | title
 1 |   20   |  nikita
 1 |   18   |  simba

softwares:

id | ref_id | title
 1 |   18   |  adware
 1 |   19   |  acdsee

Now I want to do a GROUP BY ref_id and get:

20
18
19


select ref_id from games
union 
select ref_id from softwares 

this answer is according to your result needed and table structure you have mention.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号