O
O
Optimus2016-08-09 06:56:36
MySQL
Optimus, 2016-08-09 06:56:36

SQL query, find difference in 2 columns?

The table has 2 columns in each of which are numbers:
id1 | id2
100 876
135 657
129 768
200 200
489 489
How to find values ​​in the right column that are not in the left? (answer: 3 values: 876, 657, 768)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2016-08-09
Pyan @marrk2

SELECT id2
FROM table t1
left join table t2 ON t1.id2=t2.id1 where
t2.id1 is null
2ee4f7db62d3481e9df4698c2af7a97d.jpg

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question