【发布时间】:2021-03-11 05:24:21
【问题描述】:
我有两张桌子
表1:
| id | columnA |
|---|---|
| 1 | one |
| 2 | two |
| 3 | one |
表2:
| table1_id | columnB |
|---|---|
| 1 | row1 |
| 2 | row2 |
| 3 | row1 |
是否可以通过单个查询从 table1 中获取我的 id,其中 columnA 中的重复值在 columnB 中也有重复值:
和这个例子一样,table1 中的 id 1 和 3 在 columnA 和 columnB 中都有重复值
【问题讨论】:
-
是的对不起错字。
标签: mysql sql group-concat composite-primary-key