question

apple12 avatar image
apple12 asked

Find the pairs that appear the most times in StoreID and each STOREID has only this pair SQL

I want to find the pairs of MOVIEID that appear more times in the STOREID. Additionally, each STOREID should have only this pair as MOVIEIDs. My table has 2 columns: STOREID and MOVIEID. For example: STOREID | MOVIEID --------|--------- 1 | a 1 | b 1 | c 2 | a 2 | b 3 | a 3 | b 3 | c 5 | a 5 | b In this case the answer would be pair: (a,b) 2 times. 5 and 2. Thanks in advance!
sqlaggregatesuniqueaggregation
1 comment
10 |1200 characters needed characters left characters exceeded

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

Wouldn't your answer be a,b,c x2 (1,3) a,b x2 (2,5) or are you only bothered about stores which only have 2 movieid's?
0 Likes 0 ·

0 Answers

· Write an Answer

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.