Y
Y
yurygolikov2017-10-13 01:17:00
MySQL
yurygolikov, 2017-10-13 01:17:00

How to get records with exact match of desired values ​​in a many-to-many relationship with a single query?

Duplicate question.
How to get records with exact match of desired values ​​in a many-to-many relationship with a single query?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
B
Boris Korobkov, 2017-10-13
@BorisKorobkov

SELECT "CUSTOMVALUE1" as A 
UNION 
SELECT "CUSTOMVALUE2" as A

V
V Sh., 2017-10-13
@JuniorNoobie

In what format does the data come from the client? JSON, XML? In any case, you can use the built-in DBMS libraries (MS SQL, ORACLE, etc) to translate incoming data into a table. Example on Oracle:

SELECT extractValue(value(t),'value') val, extractValue(value(t),'value/@id') attr
FROM TABLE(XMLSequence(XMLType('<form><value id="1">first</value><value id="2">second</value></form>').extract('form/value'))) t;

D
d-stream, 2017-10-13
@d-stream

And what's the problem?
Cumbersomeness is not a criterion. The main thing is that the optimizer-scheduler understands how to execute the query.
Here if the request is fulfilled slowly - then it is necessary to think.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question