H
H
hollanditkzn2018-03-06 15:30:40
SQL
hollanditkzn, 2018-03-06 15:30:40

How to make a query in the database, having values ​​from another?

I can’t figure out how to make a query, I need when I got the id of one database so that these records are not taken into account in another table. There may be several records.
Here is an example.
SELECT * FROM `thema` WHERE `id` <> IN(82,83)
It is a curve, but 82.83 and so on is an id obtained from another table. All of them are connected
, that is, display all records, except for those that were displayed 82.83

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Fedorov, 2018-03-06
@hollanditkzn

SELECT * 
FROM `thema` 
WHERE `id` NOT IN (SELECT получаем_ваши_82,83)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question