MySQL Forums
Forum List  »  General

Re: JOIN
Posted by: Peter Brawley
Date: December 05, 2020 04:21PM

> Sorry, no idea!

Sure you do. you've been asked for all possible combinations of firstcol and secondcol values in your table, read about cross join, then try substituting your column and table names into ...

select a.firstcol, b.secondcol
from tbl as a
cross join tbl as b
order by firstcol, secondcol;

... it'll give you 25 rows, now all you need to do is suppress the duplicates (hint: read about distinct).

Options: ReplyQuote


Subject
Written By
Posted
December 04, 2020 04:38PM
December 05, 2020 10:13AM
December 05, 2020 01:54PM
December 05, 2020 02:43PM
Re: JOIN
December 05, 2020 04:21PM
December 06, 2020 06:39AM
December 06, 2020 11:36AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.