Wrox Programmer Forums
|
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 20th, 2005, 01:12 AM
Registered User
 
Join Date: Jan 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default SQL problem

People, please explain me!!!

SQL 92

Example:
T1 (ID,Name, Date)
T2 (IDKEY, IDMAIN)
T3 (ID, Word)

T2.IDMAIN = T1.ID
T2.IDKEY = T3.ID

Want to find all the records to wich corresponds all entered by me words.

SELECT DISTINCT Main.Name, Main.Data, Main.Form, Main.Place, Main.Source, Main.Language, Main.Author
FROM "main.db" Main
   INNER JOIN "idkey.db" Idkey
   ON (Main.ID = Idkey.IDMain)
   INNER JOIN "keywords.db" Keywords
   ON (Idkey.IDKey = Keywords.ID)
WHERE (UPPER( Keywords.Text ) LIKE UPPER( '%%%keyword1%' ))
   AND (UPPER( Keywords.Text ) LIKE UPPER( '%%%keyword2%' ))

it finds nothing. I uderstand why - there is no record that posses two meenings at the same time. If I'll write OR it will find all records having keyword1 and having keyword1. But I need records having both words at the same time!

Thank you

 
Old January 20th, 2005, 03:28 AM
Registered User
 
Join Date: Jan 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Correction
I have SQL 89 - No MINUS, INTERSECT only UNION

 
Old January 20th, 2005, 09:25 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Try removing 2 % like this - LIKE UPPER( '%keyword1%' )







Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL problem MArk_dB BOOK: Beginning ASP 3.0 1 December 16th, 2007 07:33 AM
sql problem shrisangeeta Classic ASP Databases 2 May 24th, 2006 09:58 AM
SQL Problem pannet1 BOOK: Access 2003 VBA Programmer's Reference 4 April 16th, 2005 10:03 PM
SQL problem Clive Astley Access VBA 4 October 19th, 2004 10:42 AM
SQL Problem tjw Access 1 November 12th, 2003 09:22 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.