0

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.

2
  • 3
    try ('location2','location1') Commented Sep 26, 2014 at 11:58
  • @Strawberry ok sorry that is my mistake. thanks Commented Sep 26, 2014 at 12:11

1 Answer 1

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

Your error was in the quotes containing the possible values.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.