MYSQL GROUP BY 2 Tables
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.
精彩评论