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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:41:50+00:00 2026-06-08T08:41:50+00:00

I have two tables i need to query One called horse which contains the

  • 0

I have two tables i need to query
One called horse which contains the Name and Horse_id
One called entry which contains the Horse_id and the Place. (Place is the where the horse came, eg. 1st, 2nd, 3rd).

I need to use a subquery to display the horse Name and Id of every horse that has won a 1st 2nd or 3rd more than once.

So far i have (i haven’t gotten to the “more than once” part yet)

SELECT horse_id, name FROM 
(SELECT count(place) AS horse_id, name FROM entry)
WHERE entry.place<3;

Although this isn’t working. Error is “every derived table must have its own alias”. I’m not sure what i’m supposed to name and i’m finding it hard to find examples of this type of query.

I also tried:

SELECT horse_id, name FROM horse
WHERE place IN(SELECT horse_id FROM entry WHERE entry.place<3);

Not sure where i’m going wrong

  • 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-08T08:41:51+00:00Added an answer on June 8, 2026 at 8:41 am

    I apologize, should have read the question better.. just created the tables on my system this works:

    select name, horse_id 
    FROM horse LEFT JOIN 
    (select horse_id, count(horse_id) as c FROM entry where place < 4 group by horse_id) as h 
    USING (horse_id) WHERE c > 1;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables described below. What I need is a single query that
I have two different tables from which I need to pull data blogs which
I have two tables on my database. One called room and another is called
I have two tables. One of them called conversations has the following data. ConversationID
I have two tables. One contains information on hotels, added to my website by
I have two tables. One contains information on hotels, added to my website by
I have two tables. One contains Potential Customer information along with their Vehicle requirements
I have two tables - one called customer_records and another called customer_actions . customer_records
I have two tables, one called 'guilds' , and one called *'guild_colours'*. The fields
I have two tables and need top copy one to another INSERT INTO tbl_new

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.