subquery - Cheapest method for querying multiple columns with multiple values (MYSQL) -
i'm looking @ passing multiple values query retrieve rows match exact matches of values passed, matched within multiple columns.
for example, passing: "france", "special" return id 3. if pass "france" return both id 1 , 3. if pass "france","special","sacred" return empty.
this illustrative purpose, real data have more columns interrogate, , more terms passed it.
+----------------+-------------+---------+--+ | name | author | country |id | +----------------+-------------+---------+--+ | france | m. charmers | uk | 1 | | worlds apart | d. ramson | germany | 2 | | special | r. magee | france | 3 | | sacred special | d. monster | spain | 4 | +----------------+-------------+---------+--+
i'm querying quite large database , looking least expensive method interrogating data. sensible query using collection of in clauses or building subqueries?
Comments
Post a Comment