Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8685715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:38:42+00:00 2026-06-12T22:38:42+00:00

I have a MessageThread table UserUid ThreadUid =================== K1 111 N1 111 K1 222

  • 0

I have a MessageThread table

UserUid   ThreadUid
===================
K1    111
N1    111
K1    222
K1    333
N1    444
R1    111
R1    222
D1    333
E1    444
T1    555

One threadUid is only used for a same group of users.

K1 and N1 can on only have same ThreadUid.

if I know UserUid: K1 and N1

How can I know if K1 and N1 has a same ThreadUid?

Is there a way to get ThreadUid based on the provided UserUid? Seems impossible…

————

If the UserUid is K1 and N1
Result will be 111

If the UserUid is K1 and T1
Result will be empty

If the UserUid is N1 and E1
Result will be 444

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T22:38:43+00:00Added an answer on June 12, 2026 at 10:38 pm

    To find threads that both users have in common:

    select  mt1.ThreadUid
    ,       count(*) as ThreadCount
    ,       (
            select  count(distinct mt3.UserUid) 
            from    MessageThread mt3 
            where   mt1.ThreadUid = mt1.ThreadUid
            ) as UsersInThread
    from    MessageThread mt1
    join    MessageThread mt2
    on      mt1.ThreadUid = mt2.ThreadUid
    where   mt1.UserUid = 'K1'
            and mt2.UserUid = 'N1'
    group by
            mt1.ThreadUid
    

    Example at SQL Fiddle.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have deployed numerous report parts which reference the same view however one of them
have 2 questions : A computer with 32-bit address uses 2-level page table (9
Ok I have a messages table: +-----+-----------+--------------+--------------+-----------+--------+--------------+--------------+ | id | sender_id | recipient_id |
OK, this one is driving me nuts.... I have a string that is formed
I have a MessageThread entity which contains Message entities. The foreign key is set
Have one Doubt In MVC Architecture we can able to pass data from Controller
Have a simple one-off tasks which needs a progress bar. OpenSSL has a useful
Have some runtime defined schedule for one week, for example: <schedule> <s day=Monday, time=1:00:00></s>
Have you used VS.NET Architect Edition's Application and System diagrams to start designing a
I really am feeling bad. I have one web application that sends Emails for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.