MySQL Forums
Forum List  »  Newbie

Tricky query
Posted by: Vitalii Kaplenko
Date: March 31, 2023 10:30AM

Hi, MySQL team!

I've got two tables:

Table1
-------------
| Id1 | Id2 |
-------------
| 1 | 3 |
| 2 | 3 |
| 1 | 4 |
| 2 | 5 |
-------------

Table2
-------
| Id1 |
-------
| 3 |
| 4 |
-------

How can I get

Table3
-------------
| Id1 | Id2 |
-------------
| 1 | 3 |
| 1 | 4 |
-------------

From Table1 and Table2?

Any kind of joins can't help me, window functions as well.
I can get anything by sequence of temporary tables, but it's not the case.

Thanks!

Options: ReplyQuote


Subject
Written By
Posted
Tricky query
March 31, 2023 10:30AM


Sorry, only registered users may post in this forum.

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.