question

DIMITRISD19 avatar image
DIMITRISD19 asked

combine two counts from the same table

CREATETABLE Users(
uid int PRIMARYKEY,
name text,
phone text);CREATETABLE Messages(
recipient int REFERENCES Users(uid),
sender int REFERENCES Users(uid),
time timestamp NOTNULL, 

message text NOTNULL,PRIMARYKEY(recipient, sender, time));

I cant find a way how to find the users that have more messages as recipients than senders. I know how to find each one but i don't know thw way to combine them and compare them

combinationscountscompatibility
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.