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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:36:42+00:00 2026-06-01T13:36:42+00:00

I have used this query before: SELECT * FROM stone_list WHERE type IN (‘ALEXANDRITE’,’AMETHYST’)

  • 0

I have used this query before:

SELECT * 
FROM stone_list 
WHERE type IN ('ALEXANDRITE','AMETHYST') 
   AND shape IN ('OVAL') ORDER BY type, shape

It worked for me in the past, only this time it does something very weird. When I have only one value for the shape IN, the query only returns results where type is ALEXANDRITE and shape is OVAL, even though there are rows where type = AMETHYST and shape = OVAL as well.

Now, when I add a second shape, e.g. shape IN ('OVAL','ROUND'), it will return values for both type = ALEXANDRITE and type = AMETHYST and for shape = OVAL and shape = ROUND (so, it works as expected).

Really trumps me.

Anyone with any ideas?

THANKS!

  • 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-01T13:36:43+00:00Added an answer on June 1, 2026 at 1:36 pm

    There is nothing wrong with the query, so I can only assume that there is something you’ve overlooked or omitted from the question.

    mysql> select * from stone_list;
    +----+-------------+--------+
    | id | type        | shape  |
    +----+-------------+--------+
    |  1 | ALEXANDRITE | OVAL   |
    |  2 | ALEXANDRITE | ROUND  |
    |  3 | BASILIC     | OVAL   |
    |  4 | AMETHYST    | SQUARE |
    |  5 | AMETHYST    | ROUND  |
    |  6 | AMETHYST    | OVAL   |
    +----+-------------+--------+
    6 rows in set (0.00 sec)
    
    
    mysql> SELECT * FROM stone_list WHERE type IN ('ALEXANDRITE','AMETHYST') AND shape IN ('OVAL') ORDER BY type, shape
        -> ;
    +----+-------------+-------+
    | id | type        | shape |
    +----+-------------+-------+
    |  1 | ALEXANDRITE | OVAL  |
    |  6 | AMETHYST    | OVAL  |
    +----+-------------+-------+
    2 rows in set (0.00 sec)
    
    
    mysql> describe stone_list;
    +-------+------------------+------+-----+---------+----------------+
    | Field | Type             | Null | Key | Default | Extra          |
    +-------+------------------+------+-----+---------+----------------+
    | id    | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
    | type  | varchar(50)      | YES  |     | NULL    |                |
    | shape | varchar(50)      | YES  |     | NULL    |                |
    +-------+------------------+------+-----+---------+----------------+
    3 rows in set (0.00 sec)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a problem with a linq query. I have used this similarly before
I have used this query to alter the table field: ALTER TABLE `recordstudent` CHANGE
I have used this code for extracting urls from web page.But in the line
I have used this effect before, everything is in order (As far as I
I have used code like this: http://msdn.microsoft.com/en-us/library/dw70f090.aspx to access database before when working in
I have a query that looks like this: select id , int1 , int2
I have used this statements to populate jcombobox from MySql database table using Hibernate
I have never used Informix before and I'm trying to write a query that
I used to do this: SELECT layerID FROM layers WHERE ownerID = ? AND
I have this login code, which works last night before I slept. Nobody used

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.