File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to write query to obtain not 100% match?

 
tangara goh
Ranch Hand
Posts: 125
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4549
8
Java Netbeans IDE Scala
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 125
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic