Table join question
Hi, I'm trying to build a query to solve a fairly simple problem. I have two tables (A and B) linked by a common ID. I want to locate a specific record in A that is linked to two or more records in B based on second field in B matching certain criteria. I've tried every type of inner, outer, left, and right join to accomplish this, but can't come up with anything that works. EG: Select * from A inner join B on A.ID=B.ID where B.Val='25' and B.Val='35'; This will rturn zero matching records since B.Val can't equal 25 and 35 at the same time. If I substitute and with or, I will get multiple records from A that are linked to either 25 or 25. I just want the one record that is linked to both 25 AND 35. Thanks for any help. Barry Wiegan Senior Software Engineer The Scout Project http://www.scout.cs.wisc.edu/ - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Table join question
Hi, I'm trying to build a query to solve a fairly simple problem. I have two tables (A and B) linked by a common ID. I want to locate a specific record in A that is linked to two or more records in B based on second field in B matching certain criteria. I've tried every type of inner, outer, left, and right join to accomplish this, but can't come up with anything that works. EG: Select * from A inner join B on A.ID=B.ID where B.Val='25' and B.Val='35'; This will rturn zero matching records since B.Val can't equal 25 and 35 at the same time. If I substitute and with or, I will get multiple records from A that are linked to either 25 or 25. I just want the one record that is linked to both 25 AND 35. Thanks for any help. Barry Wiegan Senior Software Engineer The Scout Project http://www.scout.cs.wisc.edu/ - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Full text matching
One way you can try doing this is by implementing phrase searching after the fulltext search: ...WHERE MATCH author AGAINST('ian fleming') AND LOCATE('ian fleming', LOWER(author)) 0 I think this will work. Barry Wiegan At 17:09 19/06/01 , you wrote: Hi. We're using full text searches to search a database of books. In the absence of AND searches, promised for MySQL v4 (e.g., +joe +johnson), we're doing splitting and doing multiple full text matches. For example, charles dickens to find all books matching charles dickens, the query is done WHERE MATCH author AGAINST('charles') AND MATCH author against('dickens'). Unfortunately, for words shorter than four letters the query is ignored (presumably because it is assumed that it would return a lot of results), so a search for Ian Fleming returns zero results. Can anyone suggest how to make this work properly? - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php