Softwareontwikkeling FAQ: MySQLInhoudsopgave
FAQHoe zit het met subqueries in MySQL?MySQL ondersteunt in de versies lager dan 4.1 geen fatsoenlijke subqueries, behalve een INSERT INTO ... SELECT subquery. Nu gebruik je die doorgaans om tabellen te kopiëren, en dat is niet bepaald een dagelijkse bezigheid te noemen.
De meeste gevallen van sub-selects kun je oplossen door gebruik te maken van JOINS. Zie voor meer informatie over joins dit stukje uit de SQL FAQ.
Wanneer je de beschikking hebt over MySQL 4.1 of hoger, dan kun je wel subqueries gebruiken, zij het met een paar beperkingen. Zo kun je bijvoorbeeld in een subquery geen LIMIT gebruiken. Zie voor meer informatie ook de manual.
Mijn FULLTEXT search werkt niet.  De meest gemaakte fouten met het testen van FULLTEXT searches (uit de 4.0 versie manual):- A "word" is any sequence of characters consisting of letters, digits, ''', and '_'. Any "word" that is present in the stopword list or is just too short (3 characters or less) is ignored.
- The search for the word MySQL produces no results in the above example, because that word is present in more than half the rows. As such, it is effectively treated as a stopword (that is, a word with zero semantic value). This is the most desirable behaviour -- a natural language query should not return every second row from a 1 GB table.
A word that matches half of rows in a table is less likely to locate relevant documents. In fact, it will most likely find plenty of irrelevant documents. We all know this happens far too often when we are trying to find something on the Internet with a search engine. It is with this reasoning that such rows have been assigned a low semantic value in this particular dataset. - Note: you should add at least 3 rows to the table before you try to match anything, and what you're searching for should only be contained in one of the three rows. This is because of the 50% thereshold. If you insert only one row, then now matter what you search for, it is in 50% or more of the rows in the table, and therefore disregarded.
Links |
[
Voor 43% gewijzigd door
NMe op 21-12-2019 18:12
]
'E's fighting in there!' he stuttered, grabbing the captain's arm.
'All by himself?' said the captain.
'No, with everyone!' shouted Nobby, hopping from one foot to the other.