Answer the question
In order to leave comments, you need to log in
How to write a sql query to get the same data?
Hello.
There is a table in the database like this:
I need to make a request by specifying id to get data, and if there is duplicate data in id_input, then get them.
For clarity, I'll show you a picture. Sending a request specifying id 1001, I expect to receive the following data
. I try to send such a request, but there is no result
SELECT id, id_input, id_out
FROM data
WHERE id= 1001
GROUP BY id
HAVING COUNT(DISTINCT id_input)>1
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question