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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:02:15+00:00 2026-05-23T17:02:15+00:00

I am quite new at SQL statements and I have never been very good

  • 0

I am quite new at SQL statements and I have never been very good at joins etc. I am having a problem working out how to do the following:

I have 2 tables, one called MUSIC, one called REVIEWS. The two tables link on a field called uid – records in MUSIC are unique, but there may be many reviews for each MUSIC record.

REVIEWS has a field called thumbsup, which is set to value 1 if a user gives a MUSIC the thumbs up. Otherwise, the field is zero. There may be many thumbsup in REVIEWS, one thumbsup, or no thumbsup.

I am trying to display a list of records in MUSIC, and if there is a corresponding REVIEW record that contains a thumbsup value of 1 – just one record in REVIEWS will do it – then to display an icon on the list page.

I have had a good look around various similar questions but nothing quite like this comes up. I have tried doctoring around similar kinds of joins, but frankly how it all works is beyond me. Sorry for being an idiot.

By way of evidence that I have at least had a go, so far I have come up with this based on another post:

SELECT m.*, r.thumbsup 
FROM (SELECT MAX(thumbsup) uid FROM reviews GROUP By uid) maxThumbs 
INNER JOIN reviews r ON maxThumbs.uid = reviews.uid 
INNER JOIN music m ON music.uid = reviews.uid  

Needless to say it doesn’t work 🙁

If anyone could help me out here with the right query structure I would be extremely grateful.

Many thanks

Ted.

  • 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-23T17:02:15+00:00Added an answer on May 23, 2026 at 5:02 pm
    select DISTINCT m.* from music m INNER JOIN reviews r on m.uid = r.uid where r.thumbsup > 0 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm quite new to sql and I'm having trouble writing this i have a
Hi guys, I'm quite new to SQL and I have the following question. I
Quite new to this but i have created a SQL script that groups by
I'm quite new to SQL and have a question about matching names from two
I'm quite new to PL/SQL, and am using Oracle SQL Developer to write a
Iam quite new to functions in SQL and I would like to create a
I am quite new with Linq to SQL and MVC but I follow the
How do I prevent SQL injection when it comes to ColdFusion? I'm quite new
I'm fairly new to SQL, but trying to write quite a complicated query, but
I have this: var blockRegEx = new Regex((proc sql;)(.*?)(quit;), RegexOptions.IgnoreCase | RegexOptions.Multiline); but it

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.