H
H
hrvasiliy2015-01-03 01:02:24
MySQL
hrvasiliy, 2015-01-03 01:02:24

How to select 2 identical values?

There is a table in which there are fields whose IDs are not repeated, but in a query to this table, IDs can (will) be repeated.
SELECT * FROM `table` WHERE `id` IN (1,3,7,3)
The result will be only 1 row with ID = 3, not 2. Is it possible to form a query so that the response contains 2 identical lines (if required)?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
D', 2015-01-03
@Denormalization

> but in request to the given table ID can (will be) repeated
Someone misunderstands destination IN.
If there is such a need, then you are doing something wrong, and you need to revise the architecture.

R
res2001, 2015-01-03
@res2001

select t1.*, t2.*
from table1 t1
join table2 t2 on t2.id=t1.table2id

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question