T
T
tt5402021-09-02 20:00:14
MySQL
tt540, 2021-09-02 20:00:14

How to display the identifiers of clients who do not have an account in one SQL query?

6131024e6f102839612221.png
It is necessary to write an SQL query that displays the identifiers of clients who do not have an account. As well as the identifiers of those clients that are recorded in the Dep table, but are not in the Contact table. As a result, you need to get a list of identifiers.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Akina, 2021-09-02
@tt540

SELECT client
FROM ( SELECT DISTINCT client
       FROM Dep
     UNION ALL
       SELECT client_id
       FROM Contact ) total
GROUP BY 1
HAVING COUNT(*) = 1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question