I have this database
CREATE TABLE Users(
uid int PRIMARY KEY,
name text,
phone text
);
CREATE TABLE Messages(
recipient int REFERENCES Users(uid),
sender int REFERENCES Users(uid),
time timestamp NOT NULL,
message text NOT NULL,
PRIMARY KEY (recipient, sender, time)
);
I want to find if there is a message that has been sent more than one times between users.
for example if between 1 have sent the message "Hello" to 5 and also 4 have sent it to 8 for example, I want to print the message "Hello". But if it is only sent one time then I don't want it. I want at least two times to be repeated but at different couples of users. I don't want it to appear if the users 1 and 5 have sent it 2 times.