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 6055527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:16:28+00:00 2026-05-23T08:16:28+00:00

I have 3 select queries: Query 1: select MMBID, MMBStartDate, MMBEnddate from MMBT1, MMBT2

  • 0

I have 3 select queries:

Query 1:

select MMBID, MMBStartDate, MMBEnddate from MMBT1, MMBT2
where MMBT1.Profile_ID = MMBT2.Profile_ID

Query 2:

(SELECT Profile_ID, COUNT(vp.Viewed_ProfileId) AS viewed FROM dbo.Viewed_Profiles vp
  GROUP BY vp.Profile_Id),

Query 3:

SELECT Profile_ID, COUNT(fp.Favorite_ProfileId) AS favorites FROM dbo.Favorite_Profiles fp
  GROUP BY fp.Profile_Id

Now how I combine all these 3 select sts and get the follwing columns as output

  • from Query1: MMBID, MMBStartDate, MMBEnddate
  • from query2: COUNT(vp.Viewed_ProfileId) AS viewed
  • from Query3: COUNT(fp.Favorite_ProfileId) AS favorites

Thanks for ur help
Sun

  (SELECT Profile_ID, COUNT(vp.Viewed_ProfileId) AS viewed FROM dbo.Viewed_Profiles vp
  GROUP BY vp.Profile_Id),
  (SELECT Profile_ID, COUNT(fp.Favorite_ProfileId) AS favorites FROM dbo.Favorite_Profiles fp
  GROUP BY fp.Profile_Id
   )
  • 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-23T08:16:29+00:00Added an answer on May 23, 2026 at 8:16 am
    with one as 
    (select MMBID, MMBStartDate, MMBEnddate, MMBT1.Profile_ID 
    from MMBT1, MMBT2 where MMBT1.Profile_ID = MMBT2.Profile_ID),
    two as
    (SELECT Profile_ID, COUNT(vp.Viewed_ProfileId) AS viewed 
    FROM dbo.Viewed_Profiles vp  GROUP BY vp.Profile_Id),
    three as
    (SELECT Profile_ID, COUNT(fp.Favorite_ProfileId) AS favorites 
    FROM dbo.Favorite_Profiles fp  GROUP BY fp.Profile_Id)
    
    select one.MMBID, one.MMBStartDate, one.MMBEndDate, two.viewed, three.favorites
    from one inner join two on one.Profile_ID = two.Profile_ID
    inner join  three on two.Profile_ID=three.profile_ID
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a query to select from another sub-query select. While the two queries
I have the following two queries: select count(*) from segmentation_cycle_recipients scr , segmentation_instance si
i have some queries which group datasets and count them, e.g. SELECT COUNT(*) FROM
I have the following queries: Query 1: Select * from T10,T11,T12,T13,T14 where T10.C0 =
I have two select queries: SELECT MONTH(date) AS month, count(DISTINCT ip) FROM table_name WHERE
I have 2 tables, using an inner join to query them. SELECT COUNT(table2.id) FROM
I have the following MySQL queries: Query #1: SELECT imgURL, imgTitle, FROM images Query
I have to queries: select id, name, num from pending id, name, num 1,
We have a lot of queries select * from tbl_message that get stuck on
I have 2 queries. First: SELECT * FROM `table` WHERE col='xyz' LIMIT 100 //Time

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.