Mysql – thesql select query to select from single table with multiple WHERE clauses

MySQL

i am new to database querying so apologies for this rudimentary query question. thank you in advance.

table called "neuron"  
columns in "neuron" called "neuron_id", "neuron_name" + others (not relevant here)

neuron_id is unique identifier for each neuron_name;
say there are 5 entries, thus
neuron_id = 1,2,3,4,5 and corresponding
neuron_name = a,b,c,d,e

i would like to generate a list that contains neuron_id for select neuron_name. the following query does not work for me.

select neuron_id, neuron_name  
from neuron  
where neuron_name = "a" or "c" or "e"

i expect the following

1,a  
3,c  
5,e

but the above query only spits out

1,a

Best Answer

Try this:

select neuron_id, neuron_name  
from neuron  
where neuron_name = "a" or neuron_name = "c" or neuron_name = "e"

Edit:

The solution from ypercube is more semantically correct.

select neuron_id, neuron_name  
from neuron  
where neuron_name IN ('a', 'c', 'e')