MySQL Select Multiple VALUES

MysqlSelect

Mysql Problem Overview


Totally out of ideas here, could be needing a simple solution.

Basically my desired query is :

SELECT * FROM table WHERE id = 3,4

I want to select only the row which has ID 3 and 4, or maybe name "andy" and "paul"

Thank you very much for the answer

Mysql Solutions


Solution 1 - Mysql

Try or:

WHERE id = 3 or id = 4

Or the equivalent in:

WHERE id in (3,4)

Solution 2 - Mysql

Try this -

 select * from table where id in (3,4) or [name] in ('andy','paul');

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionHensonView Question on Stackoverflow
Solution 1 - MysqlAndomarView Answer on Stackoverflow
Solution 2 - MysqlSachin ShanbhagView Answer on Stackoverflow