Renish Khunt
Renish Khunt

Reputation: 5824

mysql where clause in not return empty?

Hello This is my table.

table name is location

id      location
1       location1
2       location2
3       location3
4       location2
5       location4
6       location3

the below are query.

SELECT * FROM location WHERE `location` IN ('location2,location1')

it return empty value i need output to all location1 and location2 records in table

i need output is

1    location1
2    location2
4    location2

thank you.

Upvotes: 0

Views: 57

Answers (1)

Kurt Du Bois
Kurt Du Bois

Reputation: 7655

SELECT * FROM location WHERE `location` IN ('location2' ,'location1') LIMIT 20

Your error was in the quotes containing the possible values.

Upvotes: 2

Related Questions