N
N
Nick Bukovskiy2017-12-25 13:52:55
MySQL
Nick Bukovskiy, 2017-12-25 13:52:55

How to build a query with the database if the key is the same and the values ​​are different?

There is a table like:
"key" => 1,
"key" => 2,
"key" => 3,
How do I select all the values? When I make a selection, my values ​​are overwritten and only the last one remains

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Dart, 2017-12-25
@sonterix

SELECT * FROM `table` WHERE `key` IN (1,2,3)
or

SELECT * FROM `table` WHERE `key`='1' OR  `key`='2' OR `key`='3'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question