Programming and Webscripting FAQ: MySQL
Links
Hoe 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.
Mijn FULLTEXT search werkt niet 
De meest gemaakte fouten met het testen van FULLTEXT searches staan gewoon in de manual vermeld:
- http://www.mysql.com/doc/en/Fulltext_Search.html
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.
- http://www.mysql.com/doc/en/Fulltext_Search.html
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.
- http://www.mysql.com/doc/en/Fulltext_Search.html (eerste user comment)
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.
[ Voor 143% gewijzigd door curry684 op 20-07-2005 11:07 ]
Music is the pleasure the human mind experiences from counting without being aware that it is counting
~ Gottfried Leibniz