MySQL SELECT发出两个不同的行,同一个地方

时间:2015-12-19 00:44:41

标签: mysql mysqli

------------------------------
| member          | place    |
|-----------------|----------|
| 3               | 1        |
| 6               | 2        |
| s8d9fg8328d55   | 1        |
| 744             | 2        |
------------------------------

我想要的是一个查询,它将2个成员与同一个地方配对。让我们说:

Example 1:
------------------
SELECT `place` FROM `table` WHERE `member`='3' AND `member`='s8d9fg8328d55'
------------------  
Expected output: `place` = 1

Example 2:
------------------
SELECT `place` FROM `table` WHERE `member`='4' AND `member`='s8d9fg8328d55'
------------------  
Expected output: no rows

感谢。

0 个答案:

没有答案