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

  • SEARCH
  • Home
  • 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 6241825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:50:17+00:00 2026-05-24T11:50:17+00:00

I have three tables for streaming data from database stream_master stream_id user_id -> foreign

  • 0

I have three tables for streaming data from database

stream_master
    stream_id
    user_id -> foreign Key
    stream_title
    stream_content

user
    user_id
    user_name
    password


stream_likes
    stream_like_id
    stream_id
    user_id

I can join together to get data stream, but I want to get “stream_likes” data for each “stream_master” rows, based on user(Logged in) activity. Mean if user already like stream get 1 for each row

Is this possible to execute in single query ?

my output should be :

[stream_id => 10,
user_id => 10015,
stream_title=>"title of stream",
stream_content="stream content",
stream_like=>1],
[stream_id => 10,
user_id => 10018,
stream_title=>"title of stream222",
stream_content="stream content22",
stream_like=>0]

I am not able to find a nice solution for this. Could someone can help me on this?

Thanks

Peter

  • 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-05-24T11:50:18+00:00Added an answer on May 24, 2026 at 11:50 am
    SELECT m.*, IF(l.stream_like_id IS NOT NULL, 1, 0) AS stream_like
    FROM stream_master m
    LEFT JOIN stream_likes l
    ON m.stream_id = l.stream_id AND m.user_id = l.user_id
    

    Would that work for you?

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

Sidebar

Related Questions

I have three tables: Type --------------------- TypeID (primary key) ParentTypeID (foreign key) TypeDescription (...)
I have three tables I'm getting info from: User, Field, FieldUserInput. I already know
I have three tables: user(id, name); tasks(id, user_id, text, date); bonus(id, user_id, sum, date,
I have three tables: page, attachment, page-attachment I have data like this: page ID
I have three tables tag , page , pagetag With the data below page
Assuming I have three tables : TableA (key, value) TableB (key, value) TableC (key,
I have a MySql database with three tables I need to combine in a
I have three tables. Product, Company, Employee ProductId of Product table is foregin key
Suppose I have three tables: user , group and xref , a table that
I have three tables: table "package" ----------------------------------------------------- package_id int(10) primary key, auto-increment package_name varchar(255)

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.