开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜