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
To select multiple values, you can use where clause with OR and IN operator.
Note – Use of IN for matching multiple values i.e. TOYOTA and HONDA in the same column i.e. COMPANY. Syntax: SELECT * FROM TABLE_NAME WHERE COLUMN_NAME IN (MATCHING_VALUE1,MATCHING_VALUE2);
The MySQL BETWEEN OperatorThe BETWEEN operator selects values within a given range. The values can be numbers, text, or dates. The BETWEEN operator is inclusive: begin and end values are included.
Try or
:
WHERE id = 3 or id = 4
Or the equivalent in
:
WHERE id in (3,4)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With