I really need help with the below query written in MySQL I want to convert in Oracle pl/sql. I read some Oracle text document and I suppose that for MATCH AGAINST
in MySQL I can use CONTAINS
in Oracle, but I have a problem converting the columns score, score0 and score1.
SELECT table_id,
MATCH(text) AGAINST('grand hotel') AS score,
MATCH(text) AGAINST('grand') AS score0,
MATCH(text) AGAINST('hotel') AS score1
FROM tbl
WHERE MATCH(text) AGAINST('grand hotel')
ORDER BY score ASC
I suppose the documentation you refer in your question is Oracle Text and that you're already somewhat familiar with the feature. You also give no reason why PL/SQL should be involved so below is a simple plain SQL example that should address your question:
The data
Oracle Text index
The query
Results
Hope this helps !