Answer the question
In order to leave comments, you need to log in
Remove from the database by comparing with the values that are written in one field separated by commas?
There is a table
id - photo - his
in the his field, the data is written like this: 343-2, 123-1, 453-2, 355-1, 324-1,
234-2 -2, 123-1, 453-2) take 343,123,453 (this is the id) and display their photo
Answer the question
In order to leave comments, you need to log in
Try like this:
SELECT a.photo
FROM table AS a
WHERE EXISTS (SELECT 1 FROM table AS b WHERE ','||b.his||',' LIKE '%,'||a.id||'-_,%' AND b.id = <определенное id>);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question