M
M
mrim2018-02-06 21:54:52
MySQL
mrim, 2018-02-06 21:54:52

mysql. Query to select non-intersecting values ​​of two columns?

There are data of two columns
cid fid
+-----+-----+
| 24 | 12 |
+-----+-----+
| 24 | 19 |
+-----+-----+
| 25 | 19 |
+-----+-----+
| 24 | 12 |
+-----+-----+
| 25 | 12 |
+-----+-----+
You need to get the following result
+-----+-----+
| 24 | 12 |
+-----+-----+
| 24 | 19 |
+-----+-----+
| 25 | 19 |
+-----+-----+
| 25 | 12 |
+-----+-----+

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
roswell, 2018-02-06
@mrim

SELECT DISTINCT( f2 ), f1 FROM t;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question