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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:10:43+00:00 2026-06-05T16:10:43+00:00

I have a MySQL database table called Participant that looks something like this: (idParticipant)

  • 0

I have a MySQL database table called Participant that looks something like this:

(idParticipant) - (firstName) - (secondName) - (gender) - (dob)

118   John     Dunne         m    1944-04-01

117   Mary     Delaney       f    1955-05-03

116   Adam     Bermingham    m    1920-01-01

115   Eamonn   Reilly        m    1987-03-19

114   Aaron    Duane         m    1990-07-08

119   Sarah    Calvin        f    1977-07-17

When I use this query:

SELECT * FROM `Participant` WHERE idParticipant = 118 OR 119;

I think I should get the following result:

118  John    Dunne       m    1944-04-01

119  Sarah   Calvin      f    1977-07-17

But instead it just returns the whole table. Where am I going wrong in my MySQL syntax?

  • 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-05T16:10:45+00:00Added an answer on June 5, 2026 at 4:10 pm

    You need to use WHERE idParticipant IN (118, 119);

    My guess is that MySQL is implicitly converting the value of 119 to a Boolean true value, so you are saying: WHERE idParticipant = 118 OR TRUE;, thus including all the rows. The equality is evaluated first, followed by the Boolean OR.

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

Sidebar

Related Questions

I have a MYSQL database table called 'wp_quotes' with a field that contains a
I have a table called products in a MySQL database. products looks some what
I have this database with a table and a row called 'rank'. In that
I have a mysql database table called character with columns like name, strength, intelligence,
I have a table in my MySQL database called Sponsors . This table has
Ok so i have a database table called requests with this structure mysql> desc
I have a MySQL Database. In it's table is a field called 'itm_name' I'm
I have mysql database structure like below: CREATE TABLE test ( id int(11) NOT
I have a mysql database with a table structure like below : Table Name
I have a MySQL database table called submission with a field called points with

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.