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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:39:06+00:00 2026-06-03T05:39:06+00:00

My two tables are Entry event_id competitor_id place 101 101 1 101 102 2

  • 0

My two tables are

Entry
event_id   competitor_id   place
101        101             1
101        102             2
101        201             3
101        301             4
102        201             2
103        201             3

second table lists prizes on offer for the events

Prize
event_id   place          money
101        1              120
101        2              60
101        3              30
102        1              10
102        2              5
102        3              2
103        1              100
103        2              60
103        3              40

From this I am looking to show all the information from the Entry table alongside the amount of money they won for their respected placing. If they failed to place in the money then a 0 will be displayed.

Any help would be appreciated.

  • 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-03T05:39:07+00:00Added an answer on June 3, 2026 at 5:39 am

    try this:

    SELECT  a.Event_ID, 
            a.Competitor_ID,
            a.Place,
            COALESCE(b.money, 0) as `Money`
    FROM    entry a left join prize b
                on  (a.event_id = b.event_ID) AND
                    (a.place = b.Place)
    

    hope this helps.

    EVENT_ID    COMPETITOR_ID   PLACE   MONEY
    101           101            1      120
    101           102            2       60
    101           201            3       30
    101           301            4        0   -- << this is what you're looking for
    102           201            2        5
    103           201            3       40
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a view from the following two tables: Entry: entry_id entry_date
Create two tables with some ids overlapping. create table outer_table ( id integer, overlap_in
My database (sqlite3), has two tables with the following schemas: CREATE TABLE log(d date,
I have created two tables ORDERS and ORDERITEMS with the following constraint: alter table
I have two tables: CREATE TABLE Event_details( event_no INTEGER AUTOINCREMENT NOT NULL, no_players INTEGER
I have two tables orders and orderdetails table orders (PK = id, UNIQUE index
i want to do for a table something like this. I have two tables
I have two tables, table1 has a entry_ID , entry_date and other entry information.
I have two tables table 1 : id, name, age, gender. table 2(friend) :
I have two tables (lets call them table A and B) both of them

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.