wood burning stoves 2.0*
The moose likes JDBC and the fly likes How to write query to obtain not 100% match? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to write query to obtain not 100% match?" Watch "How to write query to obtain not 100% match?" New topic
Author

How to write query to obtain not 100% match?

tangara goh
Ranch Hand

Joined: Dec 27, 2009
Posts: 125
Dear experts,

I manage to come up with the 'matching' codes.

However, it doesn't produce exactly what I want and I'm stuck so I hope someone can advise me the correct way to do the query. Thanks.

What I'm trying to achieve is:

Parents ID and contact together with the tutors name and contact and subjects taught will be displayed once a match is found.

However, I want not just perfect match. I want something like a 80% match also be displayed.

So I try to put in (Parents.strSubjectsP LIKE '%' = Member.strSubject)

So tutor that can teach the subjects that the parents want and able to teach other subjects be displayed as well, not just the 100% match.


Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4240
    
    7

I think the first thing you need to do is define what you mean by "80% match". There's no absolute definition of this - you need to decide what it means. Once you've done that, then you can work out how to write a query for it.
tangara goh
Ranch Hand

Joined: Dec 27, 2009
Posts: 125
Basically what I want is that if the tutor's subjects and the parent's subjects are matched, it will be displayed.

Now, it gives me 100% match only :

Math = Math.

But I want to include Math, Science = Math also be included.

Hence I use the parent.subject LIKE '%' = member.subject.

Could you tell me how to query something like that and it will auto run every time the program is run? Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to write query to obtain not 100% match?
 
Similar Threads
Hibernate: Join fetching (non lazy) of an object.
What would be the best way forward to do the matching?
Query to not duplicate join results (resolved)
Microsoft Access Store Query
Cell Widget Table in GWT 2.1.0 with expanded/collapsed rows